Class: Console::Command

Inherits:
Object show all
Defined in:
lib/more/facets/command.rb

Overview

Command base class

See MasterCommand for example.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments.



232
233
234
# File 'lib/more/facets/command.rb', line 232

def arguments
  @arguments
end

#optionsObject (readonly)

Returns the value of attribute options.



233
234
235
# File 'lib/more/facets/command.rb', line 233

def options
  @options
end

Class Method Details

.option_arity(arity_hash = nil) ⇒ Object



218
219
220
221
222
223
# File 'lib/more/facets/command.rb', line 218

def self.option_arity(arity_hash=nil)
  if arity_hash
    (@option_arity ||= {}).merge!(arity_hash)
  end
  @option_arity
end

.start(line = nil) ⇒ Object



225
226
227
228
229
230
# File 'lib/more/facets/command.rb', line 225

def self.start(line=nil)
  cargs = Console::Argument.new(line || ARGV, option_arity)
  pre = cargs.preoptions
  args, opts = *cargs.parameters
  new(args, opts).call
end

Instance Method Details

#callObject



237
238
239
# File 'lib/more/facets/command.rb', line 237

def call
  puts "Not implemented yet."
end