class Apitizer::Routing::Path
Attributes
node[R]
steps[R]
Public Class Methods
new(options = {})
click to toggle source
# File lib/apitizer/routing/path.rb, line 6 def initialize(options = {}) @steps = options[:steps] || [] @node = options[:node] end
Public Instance Methods
address()
click to toggle source
# File lib/apitizer/routing/path.rb, line 11 def address @steps.map(&:to_s).join('/') end
advance(step, options)
click to toggle source
# File lib/apitizer/routing/path.rb, line 15 def advance(step, options) @steps << step @node = options.fetch(:node) @on = options[:on] end
clone()
click to toggle source
# File lib/apitizer/routing/path.rb, line 29 def clone self.class.new(steps: @steps.clone, node: @node) end
on?(on)
click to toggle source
# File lib/apitizer/routing/path.rb, line 25 def on?(on) @on == on end
permit?(action)
click to toggle source
# File lib/apitizer/routing/path.rb, line 21 def permit?(action) @node && @node.permit?(action, on: @on) end