Class: Files::ClickwrapAcceptance
- Inherits:
-
Object
- Object
- Files::ClickwrapAcceptance
- Defined in:
- lib/files.com/models/clickwrap_acceptance.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
-
.create(params = {}, options = {}) ⇒ Object
Parameters: clickwrap_id (required) - int64.
Instance Method Summary collapse
-
#clickwrap_id ⇒ Object
int64 - Clickwrap ID.
- #clickwrap_id=(value) ⇒ Object
-
#created_at ⇒ Object
date-time - Acceptance timestamp.
-
#id ⇒ Object
int64 - Clickwrap Acceptance ID.
- #id=(value) ⇒ Object
-
#initialize(attributes = {}, options = {}) ⇒ ClickwrapAcceptance
constructor
A new instance of ClickwrapAcceptance.
- #save ⇒ Object
Constructor Details
#initialize(attributes = {}, options = {}) ⇒ ClickwrapAcceptance
Returns a new instance of ClickwrapAcceptance.
7 8 9 10 |
# File 'lib/files.com/models/clickwrap_acceptance.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/clickwrap_acceptance.rb', line 5 def attributes @attributes end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/files.com/models/clickwrap_acceptance.rb', line 5 def @options end |
Class Method Details
.create(params = {}, options = {}) ⇒ Object
Parameters:
clickwrap_id (required) - int64
48 49 50 51 52 53 54 |
# File 'lib/files.com/models/clickwrap_acceptance.rb', line 48 def self.create(params = {}, = {}) raise InvalidParameterError.new("Bad parameter: clickwrap_id must be an Integer") if params[:clickwrap_id] and !params[:clickwrap_id].is_a?(Integer) raise MissingParameterError.new("Parameter missing: clickwrap_id") unless params[:clickwrap_id] response, = Api.send_request("/clickwrap_acceptances", :post, params, ) ClickwrapAcceptance.new(response.data, ) end |
Instance Method Details
#clickwrap_id ⇒ Object
int64 - Clickwrap ID
22 23 24 |
# File 'lib/files.com/models/clickwrap_acceptance.rb', line 22 def clickwrap_id @attributes[:clickwrap_id] end |
#clickwrap_id=(value) ⇒ Object
26 27 28 |
# File 'lib/files.com/models/clickwrap_acceptance.rb', line 26 def clickwrap_id=(value) @attributes[:clickwrap_id] = value end |
#created_at ⇒ Object
date-time - Acceptance timestamp
31 32 33 |
# File 'lib/files.com/models/clickwrap_acceptance.rb', line 31 def created_at @attributes[:created_at] end |
#id ⇒ Object
int64 - Clickwrap Acceptance ID
13 14 15 |
# File 'lib/files.com/models/clickwrap_acceptance.rb', line 13 def id @attributes[:id] end |
#id=(value) ⇒ Object
17 18 19 |
# File 'lib/files.com/models/clickwrap_acceptance.rb', line 17 def id=(value) @attributes[:id] = value end |
#save ⇒ Object
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/files.com/models/clickwrap_acceptance.rb', line 35 def save if @attributes[:id] raise NotImplementedError.new("The ClickwrapAcceptance object doesn't support updates.") else new_obj = ClickwrapAcceptance.create(@attributes, @options) end @attributes = new_obj.attributes true end |