Class: Mapper::Resource
- Inherits:
-
Object
- Object
- Mapper::Resource
- Defined in:
- lib/middleman-router/mapper.rb
Overview
A Resource class for a route. Basically just a way to hold data for a route
Instance Attribute Summary collapse
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#name ⇒ Object
Returns the value of attribute name.
-
#path ⇒ Object
Returns the value of attribute path.
-
#route_name ⇒ Object
Returns the value of attribute route_name.
Instance Method Summary collapse
- #enabled? ⇒ Boolean
-
#initialize(options = {}) ⇒ Resource
constructor
A new instance of Resource.
Constructor Details
#initialize(options = {}) ⇒ Resource
Returns a new instance of Resource.
7 8 9 10 11 12 |
# File 'lib/middleman-router/mapper.rb', line 7 def initialize(={}) @name = [:name] @route_name = [:route_name] @path = [:path] @enabled = [:enabled] end |
Instance Attribute Details
#enabled ⇒ Object
Returns the value of attribute enabled.
5 6 7 |
# File 'lib/middleman-router/mapper.rb', line 5 def enabled @enabled end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/middleman-router/mapper.rb', line 5 def name @name end |
#path ⇒ Object
Returns the value of attribute path.
5 6 7 |
# File 'lib/middleman-router/mapper.rb', line 5 def path @path end |
#route_name ⇒ Object
Returns the value of attribute route_name.
5 6 7 |
# File 'lib/middleman-router/mapper.rb', line 5 def route_name @route_name end |
Instance Method Details
#enabled? ⇒ Boolean
14 15 16 |
# File 'lib/middleman-router/mapper.rb', line 14 def enabled? @enabled == true end |