Class: Billy::Commands::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/billy/commands/command.rb

Direct Known Subclasses

Config, Eat, Hello, Walk

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Class Attribute Details

._instanceObject

Returns the value of attribute _instance.



22
23
24
# File 'lib/billy/commands/command.rb', line 22

def _instance
  @_instance
end

Class Method Details

.instanceObject



24
25
26
# File 'lib/billy/commands/command.rb', line 24

def instance
  self._instance ||= self.new
end

.register_self!Object



28
29
30
# File 'lib/billy/commands/command.rb', line 28

def register_self!
  Billy::Commands.register_command!( instance )
end

Instance Method Details

#nameObject



7
8
9
# File 'lib/billy/commands/command.rb', line 7

def name
  self.class.to_s.split( "::" ).last.downcase
end