class Ground::Ridge

Attributes

routes[R]
states[R]

Private Class Methods

new(data) click to toggle source
Calls superclass method
# File lib/ground/activity/ridge.rb, line 24
def initialize(data)
  super
  @verb = verb.upcase
end
route(verb, path, state) click to toggle source

路由节点的结构 [path, state]

# File lib/ground/activity/ridge.rb, line 12
def route(verb, path, state)

  @routes ||= {'GET' => [], 'POST' => []}
  @states ||= []
  
  @routes[verb] << [path, state]
  @states << state if not @states.include?(state)
  
end

Private Instance Methods

call() click to toggle source
# File lib/ground/activity/ridge.rb, line 29
def call
  route(state)
end
route(state) click to toggle source
# File lib/ground/activity/ridge.rb, line 35
def route(state)
  self.class.route(verb, path, state)
end