Class: SmashRuby::Phase
- Inherits:
-
Object
- Object
- SmashRuby::Phase
- Defined in:
- lib/smash_ruby/phase.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#pools ⇒ Object
readonly
Returns the value of attribute pools.
-
#results ⇒ Object
readonly
Returns the value of attribute results.
Instance Method Summary collapse
- #build_pools(groups) ⇒ Object
-
#initialize(phase_hash) ⇒ Phase
constructor
A new instance of Phase.
Constructor Details
#initialize(phase_hash) ⇒ Phase
Returns a new instance of Phase.
6 7 8 9 |
# File 'lib/smash_ruby/phase.rb', line 6 def initialize(phase_hash) @id = phase_hash.dig('id') @name = phase_hash.dig('name') end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/smash_ruby/phase.rb', line 4 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/smash_ruby/phase.rb', line 4 def name @name end |
#pools ⇒ Object (readonly)
Returns the value of attribute pools.
4 5 6 |
# File 'lib/smash_ruby/phase.rb', line 4 def pools @pools end |
#results ⇒ Object (readonly)
Returns the value of attribute results.
4 5 6 |
# File 'lib/smash_ruby/phase.rb', line 4 def results @results end |
Instance Method Details
#build_pools(groups) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/smash_ruby/phase.rb', line 11 def build_pools(groups) @pools ||= [] if name.include? 'Pool' groups.each do |group| if group.dig('phaseId') == id @pools << SmashRuby::Pool.new(group) end end end end |