Class: RfAppSerializer
- Inherits:
-
Object
- Object
- RfAppSerializer
- Defined in:
- lib/rf_app_serializer.rb
Instance Attribute Summary collapse
-
#phases ⇒ Object
Returns the value of attribute phases.
Instance Method Summary collapse
- #active_phase ⇒ Object
- #active_step ⇒ Object
-
#initialize(phases) ⇒ RfAppSerializer
constructor
A new instance of RfAppSerializer.
Constructor Details
#initialize(phases) ⇒ RfAppSerializer
Returns a new instance of RfAppSerializer.
7 8 9 10 11 12 13 14 15 |
# File 'lib/rf_app_serializer.rb', line 7 def initialize(phases) @phases = phases.each_with_index.map do |phase, index| Phase.new( name: phase.with_indifferent_access[:name], steps: phase.with_indifferent_access[:steps], index: index ) end end |
Instance Attribute Details
#phases ⇒ Object
Returns the value of attribute phases.
5 6 7 |
# File 'lib/rf_app_serializer.rb', line 5 def phases @phases end |
Instance Method Details
#active_phase ⇒ Object
17 18 19 20 21 22 |
# File 'lib/rf_app_serializer.rb', line 17 def active_phase { name: find_active_phase.name, index: find_active_phase.index } end |
#active_step ⇒ Object
24 25 26 |
# File 'lib/rf_app_serializer.rb', line 24 def active_step find_active_phase.active_step end |