Module: Croods::Resource::Attributes::Base

Included in:
Croods::Resource::Attributes, Request, Response
Defined in:
lib/croods/resource/attributes/base.rb

Instance Method Summary collapse

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, **options)
  attribute = Croods::Attribute.new(name, type, **options)
  additional_attributes[name.to_s] = attribute
end

#additional_attributesObject



12
13
14
# File 'lib/croods/resource/attributes/base.rb', line 12

def additional_attributes
  @additional_attributes ||= {}
end

#ignored_attributesObject



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