Class: Ninsho::RoutesDrawer
- Inherits:
-
Object
- Object
- Ninsho::RoutesDrawer
- Defined in:
- lib/ninsho/routes_drawer.rb
Overview
Responsible for handling ninsho mappings and routes configuration The required value in ninsho_on is actually not used internally, but it’s inflected to find all other values.
routes_drawer.to #=> Authentication
Instance Attribute Summary collapse
-
#klass ⇒ Object
readonly
:nodoc:.
-
#resource ⇒ Object
readonly
:nodoc:.
-
#singular_name ⇒ Object
readonly
:nodoc:.
Instance Method Summary collapse
-
#initialize(name) ⇒ RoutesDrawer
constructor
A new instance of RoutesDrawer.
-
#to ⇒ Object
Gives the class the mapping points to.
Constructor Details
#initialize(name) ⇒ RoutesDrawer
Returns a new instance of RoutesDrawer.
11 12 13 14 15 |
# File 'lib/ninsho/routes_drawer.rb', line 11 def initialize(name) @resource = name.to_s @singular_name = name.to_s.singularize @klass = Ninsho.ref(@singular_name.classify) end |
Instance Attribute Details
#klass ⇒ Object (readonly)
:nodoc:
9 10 11 |
# File 'lib/ninsho/routes_drawer.rb', line 9 def klass @klass end |
#resource ⇒ Object (readonly)
:nodoc:
9 10 11 |
# File 'lib/ninsho/routes_drawer.rb', line 9 def resource @resource end |
#singular_name ⇒ Object (readonly)
:nodoc:
9 10 11 |
# File 'lib/ninsho/routes_drawer.rb', line 9 def singular_name @singular_name end |
Instance Method Details
#to ⇒ Object
Gives the class the mapping points to.
18 19 20 |
# File 'lib/ninsho/routes_drawer.rb', line 18 def to @klass.get end |