Class: LSL::Command::Single

Inherits:
Object show all
Includes:
FromHash
Defined in:
lib/lsl/command/single.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#argsObject

Returns the value of attribute args.



4
5
6
# File 'lib/lsl/command/single.rb', line 4

def args
  @args
end

#exObject

Returns the value of attribute ex.



4
5
6
# File 'lib/lsl/command/single.rb', line 4

def ex
  @ex
end

#inbound_pipeObject

Returns the value of attribute inbound_pipe.



4
5
6
# File 'lib/lsl/command/single.rb', line 4

def inbound_pipe
  @inbound_pipe
end

#optionsObject

Returns the value of attribute options.



4
5
6
# File 'lib/lsl/command/single.rb', line 4

def options
  @options
end

#rawObject

Returns the value of attribute raw.



4
5
6
# File 'lib/lsl/command/single.rb', line 4

def raw
  @raw
end

Instance Method Details

#eval?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/lsl/command/single.rb', line 6

def eval?
  raw[0..0] == "{"
end

#methodObject



15
16
17
# File 'lib/lsl/command/single.rb', line 15

def method
  ex.split(".").last
end

#objObject



18
19
20
21
# File 'lib/lsl/command/single.rb', line 18

def obj
  a = ex.split(".")
  (a.size > 1) ? eval(a.first) : nil
end

#to_hObject



9
10
11
# File 'lib/lsl/command/single.rb', line 9

def to_h
  {:ex => ex, :args => args, :options => options}
end

#urlObject



12
13
14
# File 'lib/lsl/command/single.rb', line 12

def url
  "http://localhost:4567/#{ex}" + args.map { |x| "/#{x}" }.join
end