Class: ActionController::Routing::StaticComponent

Inherits:
Component 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.



66
67
68
# File 'lib/action_controller/routing.rb', line 66

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



64
65
66
# File 'lib/action_controller/routing.rb', line 64

def value
  @value
end

Instance Method Details

#write_generation(g) ⇒ Object



76
77
78
# File 'lib/action_controller/routing.rb', line 76

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

#write_recognition(g) ⇒ Object



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

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