class Syntax::Command

Attributes

entity_method[R]
entity_name[R]
name[R]
result_name[R]

Public Instance Methods

async?() click to toggle source
# File lib/dandy/routing/syntax/command.rb, line 30
def async?
  @is_async
end
entity?() click to toggle source
# File lib/dandy/routing/syntax/command.rb, line 42
def entity?
  @entity_name && @entity_method
end
parallel?() click to toggle source
# File lib/dandy/routing/syntax/command.rb, line 34
def parallel?
  @is_parallel
end
parse() click to toggle source
# File lib/dandy/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

  if full_name.include? '.'
    parts = full_name.split('.')
    @entity_name = parts[0]
    @entity_method = parts[1]
  end

  self
end
sequential?() click to toggle source
# File lib/dandy/routing/syntax/command.rb, line 38
def sequential?
  @is_sequential
end