Class: Syntax::Command
- Inherits:
-
Treetop::Runtime::SyntaxNode
- Object
- Treetop::Runtime::SyntaxNode
- Syntax::Command
- Defined in:
- lib/silicon/routing/syntax/command.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#result_name ⇒ Object
readonly
Returns the value of attribute result_name.
Instance Method Summary collapse
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/silicon/routing/syntax/command.rb', line 3 def name @name end |
#result_name ⇒ Object (readonly)
Returns the value of attribute result_name.
3 4 5 |
# File 'lib/silicon/routing/syntax/command.rb', line 3 def result_name @result_name end |
Instance Method Details
#async? ⇒ Boolean
24 25 26 |
# File 'lib/silicon/routing/syntax/command.rb', line 24 def async? @is_async end |
#parallel? ⇒ Boolean
28 29 30 |
# File 'lib/silicon/routing/syntax/command.rb', line 28 def parallel? @is_parallel end |
#parse ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/silicon/routing/syntax/command.rb', line 5 def parse @is_async = text_value.start_with? '=*' @is_parallel = text_value.start_with? '=>' @is_sequential = text_value.start_with? '*>' full_name = text_value.sub('*>', '').sub('=*', '').sub('=>', '') if full_name.include? '@' parts = full_name.split('@') @result_name = parts[0] @name = parts[1] else @result_name = "#{full_name}_result" @name = full_name end self end |
#sequential? ⇒ Boolean
32 33 34 |
# File 'lib/silicon/routing/syntax/command.rb', line 32 def sequential? @is_sequential end |