Class: Desmoservice::Family
Instance Attribute Summary collapse
-
#members ⇒ Object
readonly
Returns the value of attribute members.
-
#subfamilies ⇒ Object
readonly
Returns the value of attribute subfamilies.
Attributes inherited from Term
#attrs, #color, #id, #localkey, #parent_id, #parent_localkey, #text
Instance Method Summary collapse
- #active? ⇒ Boolean
-
#initialize(data) ⇒ Family
constructor
A new instance of Family.
Methods inherited from Term
#[], #color?, #has_attr?, #localkey?, #text?
Constructor Details
#initialize(data) ⇒ Family
Returns a new instance of Family.
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/family.rb', line 7 def initialize(data) super(data['terme']) @subfamilies = Array.new @members = Array.new if data.has_key?('descripteurArray') data['descripteurArray'].each {|v| @members << Term.new(v)} end if data.has_key?('familleArray') data['familleArray'].each {|v| @subfamilies << Family.new(v)} end end |
Instance Attribute Details
#members ⇒ Object (readonly)
Returns the value of attribute members.
5 6 7 |
# File 'lib/family.rb', line 5 def members @members end |
#subfamilies ⇒ Object (readonly)
Returns the value of attribute subfamilies.
5 6 7 |
# File 'lib/family.rb', line 5 def subfamilies @subfamilies end |
Instance Method Details
#active? ⇒ Boolean
20 21 22 |
# File 'lib/family.rb', line 20 def active? return true end |