Class: ActionController::Routing::StaticComponent

Inherits:
Component
  • Object
show all
Defined in:
lib/action_controller/routing.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Component

#dynamic?, #key, new, #optional?

Constructor Details

#initialize(value) ⇒ StaticComponent

Returns a new instance of StaticComponent.



74
75
76
# File 'lib/action_controller/routing.rb', line 74

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



72
73
74
# File 'lib/action_controller/routing.rb', line 72

def value
  @value
end

Instance Method Details

#write_generation(g) ⇒ Object



84
85
86
# File 'lib/action_controller/routing.rb', line 84

def write_generation(g)
  g.add_segment(value) {|gp| gp.continue }
end

#write_recognition(g) ⇒ Object



78
79
80
81
82
# File 'lib/action_controller/routing.rb', line 78

def write_recognition(g)
  g.if_next_matches(value) do |gp|
    gp.move_forward {|gpp| gpp.continue}
  end
end