class Granite::Routing::Route

Attributes

action_name[R]
action_path[R]
projector_name[R]
projector_path[R]

Public Class Methods

new(projector_path, path: nil, as: nil, projector_prefix: false) click to toggle source
# File lib/granite/routing/route.rb, line 6
def initialize(projector_path, path: nil, as: nil, projector_prefix: false)
  @projector_path = projector_path
  @action_path, @projector_name = projector_path.split('#')
  @path = path
  @as = as

  @action_name = @action_path.split('/').last
  @action_name = "#{@projector_name}_#{@action_name}" if projector_prefix
end

Public Instance Methods

as() click to toggle source
# File lib/granite/routing/route.rb, line 20
def as
  @as || action_name
end
path() click to toggle source
# File lib/granite/routing/route.rb, line 16
def path
  "#{@path || action_name}(/:projector_action)"
end