Class: Desmoservice::Family

Inherits:
Term
  • Object
show all
Defined in:
lib/family.rb

Instance Attribute Summary collapse

Attributes inherited from Term

#attrs, #color, #id, #localkey, #parent_id, #parent_localkey, #text

Instance Method Summary collapse

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

#membersObject (readonly)

Returns the value of attribute members.



5
6
7
# File 'lib/family.rb', line 5

def members
  @members
end

#subfamiliesObject (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

Returns:

  • (Boolean)


20
21
22
# File 'lib/family.rb', line 20

def active?
  return true
end