Class: EveOnline::Api::SkillGroup

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/eve_online/api/skill_group.rb

Instance Method Summary collapse

Constructor Details

#initialize(fragment) ⇒ SkillGroup

Returns a new instance of SkillGroup.



7
8
9
# File 'lib/eve_online/api/skill_group.rb', line 7

def initialize fragment
  self.fragment = fragment
end

Instance Method Details

#<=>(other) ⇒ Object



19
20
21
# File 'lib/eve_online/api/skill_group.rb', line 19

def <=> other
  name <=> other.name
end

#idObject



11
12
13
# File 'lib/eve_online/api/skill_group.rb', line 11

def id
  fragment['groupID']
end

#merge(other) ⇒ Object



24
25
26
27
28
# File 'lib/eve_online/api/skill_group.rb', line 24

def merge other
  other.skills_fragment.children.each do |child|
    skills_fragment.add_child child
  end
end

#nameObject



15
16
17
# File 'lib/eve_online/api/skill_group.rb', line 15

def name
  fragment['groupName']
end

#skillsObject



30
31
32
# File 'lib/eve_online/api/skill_group.rb', line 30

def skills
  Skills.new skills_fragment
end

#skills_fragmentObject



34
35
36
# File 'lib/eve_online/api/skill_group.rb', line 34

def skills_fragment
  fragment.at_xpath './rowset'
end

#to_s(indent = 0) ⇒ Object



38
39
40
# File 'lib/eve_online/api/skill_group.rb', line 38

def to_s indent = 0
  "#{' ' * indent}#{name} Skill Group (id:#{id})\n#{skills.to_s(indent + 2)}"
end