class Syntax::Action

Attributes

commands[R]
http_verb[R]
node[R]
respond[R]

Public Instance Methods

parse(node) click to toggle source
# File lib/silicon/routing/syntax/action.rb, line 5
def parse(node)
  @node = node
  @commands = []

  elements.each do |element|
    if element.is_a? HttpVerb
      @http_verb = element.text_value
    end

    if element.is_a? Commands
      @commands = element.parse
    end

    if element.is_a? Respond
      @respond = element.parse
    end
  end

  self
end
to_hash() click to toggle source
# File lib/silicon/routing/syntax/action.rb, line 26
def to_hash
  {http_verb: @http_verb, commands: @commands, view: @respond.view, http_status: @respond.http_status}
end