Class: Billy::Commands::Command

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

Direct Known Subclasses

Config, Eat, Hello, My, Walk

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Class Attribute Details

._instanceObject

Returns the value of attribute _instance.



18
19
20
# File 'lib/billy/commands/command.rb', line 18

def _instance
  @_instance
end

Class Method Details

.instanceObject



20
21
22
# File 'lib/billy/commands/command.rb', line 20

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

.register_self!Object



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

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