Class: GitTimeMachine::Delorean
- Inherits:
-
Object
- Object
- GitTimeMachine::Delorean
- Defined in:
- lib/git_time_machine/delorean.rb
Instance Attribute Summary collapse
-
#velocity ⇒ Object
readonly
Returns the value of attribute velocity.
Instance Method Summary collapse
- #accelerate(speed) ⇒ Object
-
#initialize ⇒ Delorean
constructor
A new instance of Delorean.
Constructor Details
#initialize ⇒ Delorean
Returns a new instance of Delorean.
5 6 7 |
# File 'lib/git_time_machine/delorean.rb', line 5 def initialize @velocity = 0 end |
Instance Attribute Details
#velocity ⇒ Object (readonly)
Returns the value of attribute velocity.
3 4 5 |
# File 'lib/git_time_machine/delorean.rb', line 3 def velocity @velocity end |
Instance Method Details
#accelerate(speed) ⇒ Object
9 10 11 |
# File 'lib/git_time_machine/delorean.rb', line 9 def accelerate(speed) @velocity += speed end |