Class: EveOnline::Api::Skills
- Inherits:
-
Object
- Object
- EveOnline::Api::Skills
- Includes:
- Enumerable
- Defined in:
- lib/eve_online/api/skills.rb
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(fragment) ⇒ Skills
constructor
A new instance of Skills.
- #to_s(indent = 0) ⇒ Object
Constructor Details
#initialize(fragment) ⇒ Skills
Returns a new instance of Skills.
7 8 9 |
# File 'lib/eve_online/api/skills.rb', line 7 def initialize fragment self.fragment = fragment end |
Instance Method Details
#each ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/eve_online/api/skills.rb', line 11 def each rows = fragment.xpath './row' rows.each do |row| skill = Skill.new row yield skill end end |
#to_s(indent = 0) ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/eve_online/api/skills.rb', line 20 def to_s indent = 0 margin = " " * indent [ "#{margin}Skills (#{to_a.size})" ].tap do |s| sort.each do |skill| s << skill.to_s(indent + 2) end end.join "\n" end |