Module: SmoothOperator::Persistence::ClassMethods
- Defined in:
- lib/smooth_operator/persistence.rb
Constant Summary collapse
- METHODS_VS_HTTP_VERBS =
{ reload: :get, create: :post, update: :put, destroy: :delete }
Instance Attribute Summary collapse
Instance Method Summary collapse
- #create(attributes = nil, relative_path = nil, data = {}, options = {}) ⇒ Object
- #methods_vs_http_verbs ⇒ Object
Instance Attribute Details
#primary_key ⇒ Object
118 119 120 |
# File 'lib/smooth_operator/persistence.rb', line 118 def primary_key Helpers.get_instance_variable(self, :primary_key, 'id') end |
Instance Method Details
#create(attributes = nil, relative_path = nil, data = {}, options = {}) ⇒ Object
128 129 130 |
# File 'lib/smooth_operator/persistence.rb', line 128 def create(attributes = nil, relative_path = nil, data = {}, = {}) new(attributes).tap { |object| object.save(relative_path, data, ) } end |
#methods_vs_http_verbs ⇒ Object
114 115 116 |
# File 'lib/smooth_operator/persistence.rb', line 114 def methods_vs_http_verbs Helpers.get_instance_variable(self, :methods_vs_http_verbs, METHODS_VS_HTTP_VERBS.dup) end |