Class: DefResource::Interface
- Inherits:
-
Object
- Object
- DefResource::Interface
- Defined in:
- lib/def_resource/interface.rb
Instance Attribute Summary collapse
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
Instance Method Summary collapse
- #config ⇒ Object
-
#initialize(controller) ⇒ Interface
constructor
A new instance of Interface.
- #model ⇒ Object
- #param_key ⇒ Object
- #resource ⇒ Object
- #resources ⇒ Object
Constructor Details
#initialize(controller) ⇒ Interface
Returns a new instance of Interface.
5 6 7 |
# File 'lib/def_resource/interface.rb', line 5 def initialize controller @controller = controller end |
Instance Attribute Details
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
3 4 5 |
# File 'lib/def_resource/interface.rb', line 3 def controller @controller end |
Instance Method Details
#config ⇒ Object
13 14 15 |
# File 'lib/def_resource/interface.rb', line 13 def config controller.class.def_resource_config end |
#model ⇒ Object
9 10 11 |
# File 'lib/def_resource/interface.rb', line 9 def model config.model || default_model end |
#param_key ⇒ Object
25 26 27 |
# File 'lib/def_resource/interface.rb', line 25 def param_key model.model_name.param_key end |
#resource ⇒ Object
17 18 19 |
# File 'lib/def_resource/interface.rb', line 17 def resource config.resource || find_resource end |
#resources ⇒ Object
21 22 23 |
# File 'lib/def_resource/interface.rb', line 21 def resources find_resources end |