Class: ActionController::Routing::Component

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

Overview

:nodoc:

Direct Known Subclasses

DynamicComponent, StaticComponent

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.new(string, *args) ⇒ Object


60
61
62
63
64
65
66
67
68
# File 'lib/action_controller/routing.rb', line 60

def self.new(string, *args)
  return super(string, *args) unless self == Component
  case string
    when ':controller' then ControllerComponent.new(:controller, *args)
    when /^:(\w+)$/    then DynamicComponent.new($1, *args)
    when /^\*(\w+)$/   then PathComponent.new($1, *args)
    else StaticComponent.new(string, *args)
  end
end

Instance Method Details

#dynamic?Boolean

Returns:

  • (Boolean)

55
# File 'lib/action_controller/routing.rb', line 55

def dynamic?()  false end

#keyObject


58
# File 'lib/action_controller/routing.rb', line 58

def key() nil end

#optional?Boolean

Returns:

  • (Boolean)

56
# File 'lib/action_controller/routing.rb', line 56

def optional?() false end