Class: Waffle::Maker::Route
- Inherits:
-
Object
- Object
- Waffle::Maker::Route
- Defined in:
- lib/waffle/maker/route.rb
Defined Under Namespace
Classes: Rails
Instance Attribute Summary collapse
-
#path_position ⇒ Object
Returns the value of attribute path_position.
-
#silent_error ⇒ Object
Returns the value of attribute silent_error.
Instance Method Summary collapse
- #all ⇒ Object
- #default ⇒ Object
-
#initialize(path_position, silent_error) ⇒ Route
constructor
A new instance of Route.
- #paths ⇒ Object
Constructor Details
#initialize(path_position, silent_error) ⇒ Route
Returns a new instance of Route.
10 11 12 13 |
# File 'lib/waffle/maker/route.rb', line 10 def initialize(path_position, silent_error) self.path_position = path_position self.silent_error = silent_error end |
Instance Attribute Details
#path_position ⇒ Object
Returns the value of attribute path_position.
8 9 10 |
# File 'lib/waffle/maker/route.rb', line 8 def path_position @path_position end |
#silent_error ⇒ Object
Returns the value of attribute silent_error.
8 9 10 |
# File 'lib/waffle/maker/route.rb', line 8 def silent_error @silent_error end |
Instance Method Details
#all ⇒ Object
15 16 17 |
# File 'lib/waffle/maker/route.rb', line 15 def all defined?(::Rails) ? rails : default end |
#default ⇒ Object
26 27 28 |
# File 'lib/waffle/maker/route.rb', line 26 def default [] end |
#paths ⇒ Object
19 20 21 22 23 |
# File 'lib/waffle/maker/route.rb', line 19 def paths all.each.with_object([]) do |v, o| o << v[path_position].gsub(/\(\.:format\)$/, "") end end |