Class: Motel::MovementStrategies::Stopped

Inherits:
Motel::MovementStrategy show all
Includes:
Singleton
Defined in:
lib/motel/movement_strategies/stopped.rb

Overview

Stopped is the default MovementStrategy which does nothing

Instance Attribute Summary

Attributes inherited from Motel::MovementStrategy

#step_delay

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Motel::MovementStrategy

#change?, #initialize, #move, #to_json

Constructor Details

This class inherits a constructor from Motel::MovementStrategy

Class Method Details

.json_create(o) ⇒ Object

Return stopped movement strategy singleton instance


25
26
27
# File 'lib/motel/movement_strategies/stopped.rb', line 25

def self.json_create(o)
  self.instance
end

Instance Method Details

#to_sObject


20
21
22
# File 'lib/motel/movement_strategies/stopped.rb', line 20

def to_s
  "stopped"
end

#valid?Boolean

Returns:

  • (Boolean)

16
17
18
# File 'lib/motel/movement_strategies/stopped.rb', line 16

def valid?
  true
end