Class | Sawyer::Resource |
In: |
lib/sawyer/resource.rb
|
Parent: | Object |
SPECIAL_METHODS | = | Set.new(%w(agent rels fields)) |
ATTR_SETTER | = | '='.freeze |
ATTR_PREDICATE | = | '?'.freeze |
_agent | [R] | |
_fields | [R] | |
_rels | [R] | |
attrs | [R] |
Initializes a Resource with the given data.
agent - The Sawyer::Agent that made the API request. data - Hash of key/value properties.
Allow fields to be retrieved via Hash notation
method - key name
Returns the value from attrs if exists
Allow fields to be set via Hash notation
method - key name value - value to set for the attr key
Returns - value
Checks to see if the given key is in this resource.
key - A Symbol key.
Returns true if the key exists, or false.