Class: EveOnline::Api::SkillGroup
- Inherits:
-
Object
- Object
- EveOnline::Api::SkillGroup
- Includes:
- Comparable
- Defined in:
- lib/eve_online/api/skill_group.rb
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #id ⇒ Object
-
#initialize(fragment) ⇒ SkillGroup
constructor
A new instance of SkillGroup.
- #merge(other) ⇒ Object
- #name ⇒ Object
- #skills ⇒ Object
- #skills_fragment ⇒ Object
- #to_s(indent = 0) ⇒ Object
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 |
#id ⇒ Object
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 |
#name ⇒ Object
15 16 17 |
# File 'lib/eve_online/api/skill_group.rb', line 15 def name fragment['groupName'] end |
#skills ⇒ Object
30 31 32 |
# File 'lib/eve_online/api/skill_group.rb', line 30 def skills Skills.new skills_fragment end |
#skills_fragment ⇒ Object
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 |