Module: Croods::Resource::Attributes::Base
- Included in:
- Croods::Resource::Attributes, Request, Response
- Defined in:
- lib/croods/resource/attributes/base.rb
Instance Method Summary collapse
- #add_attribute(name, type, **options) ⇒ Object
- #additional_attributes ⇒ Object
- #ignored_attributes ⇒ Object
- #skip_attributes(*names) ⇒ Object (also: #skip_attribute)
Instance Method Details
#add_attribute(name, type, **options) ⇒ Object
7 8 9 10 |
# File 'lib/croods/resource/attributes/base.rb', line 7 def add_attribute(name, type, **) attribute = Croods::Attribute.new(name, type, **) additional_attributes[name.to_s] = attribute end |
#additional_attributes ⇒ Object
12 13 14 |
# File 'lib/croods/resource/attributes/base.rb', line 12 def additional_attributes @additional_attributes ||= {} end |
#ignored_attributes ⇒ Object
22 23 24 |
# File 'lib/croods/resource/attributes/base.rb', line 22 def ignored_attributes @ignored_attributes ||= [] end |
#skip_attributes(*names) ⇒ Object Also known as: skip_attribute
16 17 18 19 20 |
# File 'lib/croods/resource/attributes/base.rb', line 16 def skip_attributes(*names) names.each do |name| ignored_attributes << name.to_s end end |