Class: Sidemash::Sdk::StreamSquareService
- Inherits:
-
Object
- Object
- Sidemash::Sdk::StreamSquareService
- Defined in:
- lib/sidemash/sdk/stream_square_service.rb
Instance Method Summary collapse
- #create(form) ⇒ Object
- #delete(id) ⇒ Object
- #get(id) ⇒ Object
-
#initialize(auth) ⇒ StreamSquareService
constructor
A new instance of StreamSquareService.
- #list(form = nil) ⇒ Object
- #to_s ⇒ Object
- #update(form) ⇒ Object
Constructor Details
#initialize(auth) ⇒ StreamSquareService
Returns a new instance of StreamSquareService.
22 23 24 25 |
# File 'lib/sidemash/sdk/stream_square_service.rb', line 22 def initialize(auth) @_type = 'StreamSquareService' @auth = auth end |
Instance Method Details
#create(form) ⇒ Object
27 28 29 30 |
# File 'lib/sidemash/sdk/stream_square_service.rb', line 27 def create(form) remote = Http.post('/' + Http.version + '/stream-squares', form.to_json, "", {}, @auth) StreamSquare.from_hash(remote) end |
#delete(id) ⇒ Object
48 49 50 |
# File 'lib/sidemash/sdk/stream_square_service.rb', line 48 def delete(id) Http.delete('/' + Http.version + '/stream-squares/' + id, nil, "", {}, @auth) end |
#get(id) ⇒ Object
32 33 34 35 |
# File 'lib/sidemash/sdk/stream_square_service.rb', line 32 def get(id) remote = Http.get('/' + Http.version + '/stream-squares/' + id, "", {}, @auth) StreamSquare.from_hash(remote) end |
#list(form = nil) ⇒ Object
37 38 39 40 41 |
# File 'lib/sidemash/sdk/stream_square_service.rb', line 37 def list(form = nil) qs = form.nil? ? ListForm.empty.to_query_string : form.to_query_string remote = Http.list('/' + Http.version + '/stream-squares', qs, {}, @auth) StreamSquareRestCollection.from_hash(remote) end |
#to_s ⇒ Object
52 53 54 |
# File 'lib/sidemash/sdk/stream_square_service.rb', line 52 def to_s 'StreamSquareService(auth=' + @auth.to_s + ')' end |
#update(form) ⇒ Object
43 44 45 46 |
# File 'lib/sidemash/sdk/stream_square_service.rb', line 43 def update(form) remote = Http.patch('/' + Http.version + '/stream-squares/' + form.id, form.to_json, "", {}, @auth) StreamSquare.from_hash(remote) end |