Module: FbGraph2::AttributeAssigner::ClassMethods

Defined in:
lib/fb_graph2/attribute_assigner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#registered_attributesObject (readonly)

Returns the value of attribute registered_attributes.



11
12
13
# File 'lib/fb_graph2/attribute_assigner.rb', line 11

def registered_attributes
  @registered_attributes
end

Instance Method Details

#inherited(child) ⇒ Object



13
14
15
16
# File 'lib/fb_graph2/attribute_assigner.rb', line 13

def inherited(child)
  super
  child.register_attributes registered_attributes
end

#register_attributes(attributes) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/fb_graph2/attribute_assigner.rb', line 22

def register_attributes(attributes)
  attributes.each do |type, keys|
    registered_attributes[type] ||= []
    registered_attributes[type] += keys
  end
  send :attr_accessor, *attributes.values.flatten
end