Class: Maestro::Command::Time
- Inherits:
-
StoryUpdater
- Object
- Maestro::Command
- StoryUpdater
- Maestro::Command::Time
- Defined in:
- lib/commands/story_commands.rb
Instance Method Summary collapse
-
#initialize(number, time) ⇒ Time
constructor
A new instance of Time.
- #invoke ⇒ Object
Methods inherited from Maestro::Command
Constructor Details
#initialize(number, time) ⇒ Time
Returns a new instance of Time.
39 40 41 42 |
# File 'lib/commands/story_commands.rb', line 39 def initialize(number, time) @number = number @time = time end |
Instance Method Details
#invoke ⇒ Object
44 45 46 47 48 |
# File 'lib/commands/story_commands.rb', line 44 def invoke hours, minutes = @time.split(":") story = update :time, (hours.to_i * 60 + (minutes.to_i || 0)) story.to_s + " time: #{(story.time / 60).to_i}:#{(story.time % 60).to_i}" end |