Class: Files::PartnerSite
- Inherits:
-
Object
- Object
- Files::PartnerSite
- Defined in:
- lib/files.com/models/partner_site.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
- #delete(params = {}) ⇒ Object
- #destroy(params = {}) ⇒ Object
-
#initialize(attributes = {}, options = {}) ⇒ PartnerSite
constructor
A new instance of PartnerSite.
Constructor Details
#initialize(attributes = {}, options = {}) ⇒ PartnerSite
Returns a new instance of PartnerSite.
7 8 9 10 |
# File 'lib/files.com/models/partner_site.rb', line 7 def initialize(attributes = {}, = {}) @attributes = attributes || {} @options = || {} end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
5 6 7 |
# File 'lib/files.com/models/partner_site.rb', line 5 def attributes @attributes end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/files.com/models/partner_site.rb', line 5 def @options end |
Class Method Details
.delete(id, params = {}, options = {}) ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/files.com/models/partner_site.rb', line 27 def self.delete(id, params = {}, = {}) params ||= {} params[:id] = id raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise MissingParameterError.new("Parameter missing: id") unless params[:id] Api.send_request("/partner_sites/#{params[:id]}", :delete, params, ) nil end |
.destroy(id, params = {}, options = {}) ⇒ Object
37 38 39 40 |
# File 'lib/files.com/models/partner_site.rb', line 37 def self.destroy(id, params = {}, = {}) delete(id, params, ) nil end |
Instance Method Details
#delete(params = {}) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/files.com/models/partner_site.rb', line 12 def delete(params = {}) params ||= {} params[:id] = @attributes[:id] raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id] raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise MissingParameterError.new("Parameter missing: id") unless params[:id] Api.send_request("/partner_sites/#{@attributes[:id]}", :delete, params, @options) end |
#destroy(params = {}) ⇒ Object
22 23 24 25 |
# File 'lib/files.com/models/partner_site.rb', line 22 def destroy(params = {}) delete(params) nil end |