Module: Firebrew::Entity::ClassMethod

Defined in:
lib/firebrew/entity.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes.



10
11
12
# File 'lib/firebrew/entity.rb', line 10

def attributes
  @attributes
end

Class Method Details

.extended(base) ⇒ Object



12
13
14
# File 'lib/firebrew/entity.rb', line 12

def self.extended(base)
  base.attributes = []
end

Instance Method Details

#entity_attr(*attrs) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/firebrew/entity.rb', line 20

def entity_attr(*attrs)
  attrs.uniq!
  common = self.attributes & attrs
  adding = attrs - common
  self.attributes.push(*adding)
  attr_accessor *adding
  adding
end

#inherited(base) ⇒ Object



16
17
18
# File 'lib/firebrew/entity.rb', line 16

def inherited(base)
  base.attributes = self.attributes.clone
end