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