Class: ActionController::Routing::Optimisation::Optimiser
- Defined in:
- lib/action_controller/routing/optimisations.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#route ⇒ Object
readonly
Returns the value of attribute route.
Instance Method Summary collapse
-
#applicable? ⇒ Boolean
Temporarily disabled
:url
optimisation pending proper solution to Issues around request.host etc. - #generation_code ⇒ Object
- #guard_condition ⇒ Object
-
#initialize(route, kind) ⇒ Optimiser
constructor
A new instance of Optimiser.
- #source_code ⇒ Object
Constructor Details
#initialize(route, kind) ⇒ Optimiser
Returns a new instance of Optimiser.
23 24 25 26 |
# File 'lib/action_controller/routing/optimisations.rb', line 23 def initialize(route, kind) @route = route @kind = kind end |
Instance Attribute Details
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
22 23 24 |
# File 'lib/action_controller/routing/optimisations.rb', line 22 def kind @kind end |
#route ⇒ Object (readonly)
Returns the value of attribute route.
22 23 24 |
# File 'lib/action_controller/routing/optimisations.rb', line 22 def route @route end |
Instance Method Details
#applicable? ⇒ Boolean
Temporarily disabled :url
optimisation pending proper solution to Issues around request.host etc.
46 47 48 |
# File 'lib/action_controller/routing/optimisations.rb', line 46 def applicable? true end |
#generation_code ⇒ Object
32 33 34 |
# File 'lib/action_controller/routing/optimisations.rb', line 32 def generation_code 'nil' end |
#guard_condition ⇒ Object
28 29 30 |
# File 'lib/action_controller/routing/optimisations.rb', line 28 def guard_condition 'false' end |
#source_code ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/action_controller/routing/optimisations.rb', line 36 def source_code if applicable? "return #{generation_code} if #{guard_condition}\n" else "\n" end end |