Class: JSONAPI::Deserializable::Resource::Configuration
- Inherits:
-
Object
- Object
- JSONAPI::Deserializable::Resource::Configuration
- Defined in:
- lib/jsonapi/deserializable/resource/configuration.rb
Constant Summary collapse
- DEFAULT_TYPE_BLOCK =
proc { |t| { type: t } }
- DEFAULT_ID_BLOCK =
proc { |i| { id: i } }
- DEFAULT_ATTR_BLOCK =
proc { |k, v| { k.to_sym => v } }
- DEFAULT_HAS_ONE_BLOCK =
proc do |k, _, i, t| { "#{k}_id".to_sym => i, "#{k}_type".to_sym => t } end
- DEFAULT_HAS_MANY_BLOCK =
proc do |k, _, i, t| { "#{k}_ids".to_sym => i, "#{k}_types".to_sym => t } end
Instance Attribute Summary collapse
-
#default_attribute ⇒ Object
Returns the value of attribute default_attribute.
-
#default_has_many ⇒ Object
Returns the value of attribute default_has_many.
-
#default_has_one ⇒ Object
Returns the value of attribute default_has_one.
-
#default_id ⇒ Object
Returns the value of attribute default_id.
-
#default_type ⇒ Object
Returns the value of attribute default_type.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
18 19 20 21 22 23 24 |
# File 'lib/jsonapi/deserializable/resource/configuration.rb', line 18 def initialize self.default_type = DEFAULT_TYPE_BLOCK self.default_id = DEFAULT_ID_BLOCK self.default_attribute = DEFAULT_ATTR_BLOCK self.default_has_one = DEFAULT_HAS_ONE_BLOCK self.default_has_many = DEFAULT_HAS_MANY_BLOCK end |
Instance Attribute Details
#default_attribute ⇒ Object
Returns the value of attribute default_attribute.
15 16 17 |
# File 'lib/jsonapi/deserializable/resource/configuration.rb', line 15 def default_attribute @default_attribute end |
#default_has_many ⇒ Object
Returns the value of attribute default_has_many.
15 16 17 |
# File 'lib/jsonapi/deserializable/resource/configuration.rb', line 15 def default_has_many @default_has_many end |
#default_has_one ⇒ Object
Returns the value of attribute default_has_one.
15 16 17 |
# File 'lib/jsonapi/deserializable/resource/configuration.rb', line 15 def default_has_one @default_has_one end |
#default_id ⇒ Object
Returns the value of attribute default_id.
15 16 17 |
# File 'lib/jsonapi/deserializable/resource/configuration.rb', line 15 def default_id @default_id end |
#default_type ⇒ Object
Returns the value of attribute default_type.
15 16 17 |
# File 'lib/jsonapi/deserializable/resource/configuration.rb', line 15 def default_type @default_type end |