Module: Smooth::ModelAdapter::ClassMethods

Defined in:
lib/smooth/model_adapter.rb

Instance Method Summary collapse

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(options = {}, &block)
  acts_smooth(options, &block)
end

#acts_smooth(_options = {}, &block) ⇒ Object



14
15
16
17
18
19
# File 'lib/smooth/model_adapter.rb', line 14

def acts_smooth(_options = {}, &block)
  @smooth_resource ||= begin
                         resource_name = to_s.split('::').last.to_s.pluralize
                         Smooth.resource(resource_name, model: self, &block)
                       end
end

#smooth_resourceObject



26
27
28
# File 'lib/smooth/model_adapter.rb', line 26

def smooth_resource
  @smooth_resource || acts_as_smooth
end