Class: Dobro::Resource
- Inherits:
-
Object
- Object
- Dobro::Resource
- Defined in:
- lib/dobro/resource.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#reference ⇒ Object
Returns the value of attribute reference.
Instance Method Summary collapse
- #index_route ⇒ Object
-
#initialize(reference, options = {}) ⇒ Resource
constructor
A new instance of Resource.
- #route_for(action, object = nil) ⇒ Object
Constructor Details
#initialize(reference, options = {}) ⇒ Resource
Returns a new instance of Resource.
4 5 6 |
# File 'lib/dobro/resource.rb', line 4 def initialize(reference, = {}) @reference, @options = reference, end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
2 3 4 |
# File 'lib/dobro/resource.rb', line 2 def @options end |
#reference ⇒ Object
Returns the value of attribute reference.
2 3 4 |
# File 'lib/dobro/resource.rb', line 2 def reference @reference end |
Instance Method Details
#index_route ⇒ Object
8 9 10 |
# File 'lib/dobro/resource.rb', line 8 def index_route [namespace, reference].compact end |
#route_for(action, object = nil) ⇒ Object
12 13 14 15 |
# File 'lib/dobro/resource.rb', line 12 def route_for(action, object = nil) action, object = nil, action if object.nil? [action, namespace, object].compact end |