Access resource properties and response objects
masterAccessing properties
You can retrieve resource properties using either dot notation (accessors) or bracket notation (indexer).
- Dot notation (
customer.id): Raises aNoMethodErrorif the property is not defined. - Bracket notation (
customer['id']): Returnsnilif the property is not defined.
Accessing the response object
To access HTTP metadata like status codes or headers, use the last_response property on the returned resource.
Note: For custom hash fields like Customer.metadata, always use the [] accessor.