Class: Dogfood::StoryBase

Inherits:
Object
  • Object
show all
Defined in:
lib/dogfood/story_base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/dogfood/story_base.rb', line 5

def id
  @id
end

#rngObject (readonly)

Returns the value of attribute rng.



5
6
7
# File 'lib/dogfood/story_base.rb', line 5

def rng
  @rng
end

#stepsObject (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

Raises:

  • (NotImplementedError)


28
29
30
# File 'lib/dogfood/story_base.rb', line 28

def advance(day_index:)
  raise NotImplementedError
end

#stateObject



24
25
26
# File 'lib/dogfood/story_base.rb', line 24

def state
  @state.dup
end

#template_keyObject



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

#titleObject

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/dogfood/story_base.rb', line 16

def title
  raise NotImplementedError
end