Module: JsonApiClient::Helpers::Schemable::ClassMethods
- Defined in:
- lib/json_api_client/helpers/schemable.rb
Instance Method Summary collapse
-
#properties(*names) ⇒ Object
Declare multiple properties with the same optional options.
-
#property(name, options = {}) ⇒ Object
Declares a new property by name.
-
#schema ⇒ Schema
Returns the schema for this resource class.
Instance Method Details
#properties(*names) ⇒ Object
Declare multiple properties with the same optional options
36 37 38 39 40 41 |
# File 'lib/json_api_client/helpers/schemable.rb', line 36 def properties(*names) = names.last.is_a?(Hash) ? names.pop : {} names.each do |name| property name, end end |
#property(name, options = {}) ⇒ Object
Declares a new property by name
26 27 28 |
# File 'lib/json_api_client/helpers/schemable.rb', line 26 def property(name, = {}) schema.add(name, ) end |