Class: Dawn::Drain
- Inherits:
-
Object
- Object
- Dawn::Drain
- Includes:
- BaseApi
- Defined in:
- lib/dawn/api/models/drain.rb
Overview
:nodoc:
Instance Attribute Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
- #destroy(options = {}) ⇒ Object
-
#initialize(data) ⇒ Drain
constructor
A new instance of Drain.
- #refresh ⇒ self
Methods included from BaseApi
Methods included from BaseApi::RequestExtension
Methods included from SafeExtension
Constructor Details
#initialize(data) ⇒ Drain
Returns a new instance of Drain.
23 24 25 26 |
# File 'lib/dawn/api/models/drain.rb', line 23 def initialize(data) @app = nil @data = data end |
Instance Attribute Details
Class Method Details
.destroy(options = {}) ⇒ Object
68 69 70 71 72 73 74 75 |
# File 'lib/dawn/api/models/drain.rb', line 68 def self.destroy(={}) id = id_param() delete( path: "/drains/#{id}", query: ) end |
.find(options = {}) ⇒ Object
56 57 58 59 60 61 62 63 |
# File 'lib/dawn/api/models/drain.rb', line 56 def self.find(={}) id = id_param() new get( path: "/drains/#{id}", query: )["drain"] end |
Instance Method Details
#destroy(options = {}) ⇒ Object
49 50 51 |
# File 'lib/dawn/api/models/drain.rb', line 49 def destroy(={}) Drain.destroy(.merge(id: id)) end |
#refresh ⇒ self
38 39 40 41 42 43 44 |
# File 'lib/dawn/api/models/drain.rb', line 38 def refresh @data = get( path: "/drains/#{id}", query: )["drain"] self end |