Module: OpenX::Services::Persistance::ClassMethods
- Included in:
- Base
- Defined in:
- lib/openx/services/persistance.rb
Instance Method Summary collapse
Instance Method Details
#create!(params = {}) ⇒ Object
7 8 9 |
# File 'lib/openx/services/persistance.rb', line 7 def create!(params = {}) new(params).save! end |
#destroy(id) ⇒ Object
23 24 25 |
# File 'lib/openx/services/persistance.rb', line 23 def destroy(id) new(:id => id).destroy end |
#find(id, *args) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/openx/services/persistance.rb', line 11 def find(id, *args) if id == :all responses = remote.call(find_all, *args) responses.map do |response| new(translate(response)) end else response = remote.call(find_one, id) new(translate(response)) end end |