Module: Smooth::ModelAdapter::ClassMethods
- Defined in:
- lib/smooth/model_adapter.rb
Instance Method Summary collapse
-
#acts_real_smooth(options = {}, &block) ⇒ Object
Because it depends how you feel.
- #acts_smooth(_options = {}, &block) ⇒ Object
- #smooth_resource ⇒ Object
Instance Method Details
#acts_real_smooth(options = {}, &block) ⇒ Object
Because it depends how you feel.
22 23 24 |
# File 'lib/smooth/model_adapter.rb', line 22 def acts_real_smooth( = {}, &block) acts_smooth(, &block) end |
#acts_smooth(_options = {}, &block) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/smooth/model_adapter.rb', line 14 def acts_smooth( = {}, &block) @smooth_resource ||= begin resource_name = to_s.split('::').last.to_s.pluralize Smooth.resource(resource_name, model: self, &block) end end |
#smooth_resource ⇒ Object
26 27 28 |
# File 'lib/smooth/model_adapter.rb', line 26 def smooth_resource @smooth_resource || acts_as_smooth end |