Class: LSL::Command::Single
- Includes:
- FromHash
- Defined in:
- lib/lsl/command/single.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#ex ⇒ Object
Returns the value of attribute ex.
-
#inbound_pipe ⇒ Object
Returns the value of attribute inbound_pipe.
-
#options ⇒ Object
Returns the value of attribute options.
-
#raw ⇒ Object
Returns the value of attribute raw.
Instance Method Summary collapse
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
4 5 6 |
# File 'lib/lsl/command/single.rb', line 4 def args @args end |
#ex ⇒ Object
Returns the value of attribute ex.
4 5 6 |
# File 'lib/lsl/command/single.rb', line 4 def ex @ex end |
#inbound_pipe ⇒ Object
Returns the value of attribute inbound_pipe.
4 5 6 |
# File 'lib/lsl/command/single.rb', line 4 def inbound_pipe @inbound_pipe end |
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/lsl/command/single.rb', line 4 def @options end |
#raw ⇒ Object
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
6 7 8 |
# File 'lib/lsl/command/single.rb', line 6 def eval? raw[0..0] == "{" end |
#method ⇒ Object
15 16 17 |
# File 'lib/lsl/command/single.rb', line 15 def method ex.split(".").last end |
#obj ⇒ Object
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_h ⇒ Object
9 10 11 |
# File 'lib/lsl/command/single.rb', line 9 def to_h {:ex => ex, :args => args, :options => } end |
#url ⇒ Object
12 13 14 |
# File 'lib/lsl/command/single.rb', line 12 def url "http://localhost:4567/#{ex}" + args.map { |x| "/#{x}" }.join end |