Class: Sqwiggle::Api::Service
- Inherits:
-
Object
- Object
- Sqwiggle::Api::Service
- Defined in:
- lib/sqwiggle/api/service.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
Instance Method Summary collapse
- #all ⇒ Object
- #find(id) ⇒ Object
-
#initialize(klass, client) ⇒ Service
constructor
A new instance of Service.
- #new(params = {}) ⇒ Object
Constructor Details
#initialize(klass, client) ⇒ Service
Returns a new instance of Service.
7 8 9 |
# File 'lib/sqwiggle/api/service.rb', line 7 def initialize(klass, client) @klass, @client = klass, client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
5 6 7 |
# File 'lib/sqwiggle/api/service.rb', line 5 def client @client end |
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
5 6 7 |
# File 'lib/sqwiggle/api/service.rb', line 5 def klass @klass end |
Instance Method Details
#all ⇒ Object
11 12 13 |
# File 'lib/sqwiggle/api/service.rb', line 11 def all klass.all client end |
#find(id) ⇒ Object
15 16 17 |
# File 'lib/sqwiggle/api/service.rb', line 15 def find(id) klass.find id, client end |
#new(params = {}) ⇒ Object
19 20 21 |
# File 'lib/sqwiggle/api/service.rb', line 19 def new(params={}) klass.new ({client:client}.merge(params)) end |