Class: Colonel::Parser::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/colonel/parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Command

Returns a new instance of Command.



51
52
53
54
55
56
57
# File 'lib/colonel/parser.rb', line 51

def initialize(data)
  if data.is_a?(Array)
    @command_tokens = data
  else
    @_string = data
  end
end

Instance Method Details

#exist?Boolean

Returns:

  • (Boolean)


63
64
65
# File 'lib/colonel/parser.rb', line 63

def exist?
  @_string.size > 0
end

#getObject



59
60
61
# File 'lib/colonel/parser.rb', line 59

def get
  @_string ||= @command_tokens.join(' ')
end