Class: Dogfood::StoryBase
- Inherits:
-
Object
- Object
- Dogfood::StoryBase
- Defined in:
- lib/dogfood/story_base.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#rng ⇒ Object
readonly
Returns the value of attribute rng.
-
#steps ⇒ Object
readonly
Returns the value of attribute steps.
Instance Method Summary collapse
- #advance(day_index:) ⇒ Object
-
#initialize(rng:, id:) ⇒ StoryBase
constructor
A new instance of StoryBase.
- #state ⇒ Object
- #template_key ⇒ Object
- #title ⇒ Object
Constructor Details
#initialize(rng:, id:) ⇒ StoryBase
Returns a new instance of StoryBase.
7 8 9 10 11 12 13 14 |
# File 'lib/dogfood/story_base.rb', line 7 def initialize(rng:, id:) @rng = rng @id = id @steps = [] @state = { status: :estimate, substatus: nil } @step_number = 0 @next_stage = nil end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/dogfood/story_base.rb', line 5 def id @id end |
#rng ⇒ Object (readonly)
Returns the value of attribute rng.
5 6 7 |
# File 'lib/dogfood/story_base.rb', line 5 def rng @rng end |
#steps ⇒ Object (readonly)
Returns the value of attribute steps.
5 6 7 |
# File 'lib/dogfood/story_base.rb', line 5 def steps @steps end |
Instance Method Details
#advance(day_index:) ⇒ Object
28 29 30 |
# File 'lib/dogfood/story_base.rb', line 28 def advance(day_index:) raise NotImplementedError end |
#state ⇒ Object
24 25 26 |
# File 'lib/dogfood/story_base.rb', line 24 def state @state.dup end |
#template_key ⇒ Object
20 21 22 |
# File 'lib/dogfood/story_base.rb', line 20 def template_key self.class.name.split("::").last.gsub(/([a-z])([A-Z])/, '\1_\2').downcase end |
#title ⇒ Object
16 17 18 |
# File 'lib/dogfood/story_base.rb', line 16 def title raise NotImplementedError end |