Class: Files::BundleRecipientRegistration
- Inherits:
-
Object
- Object
- Files::BundleRecipientRegistration
- Defined in:
- lib/files.com/models/bundle_recipient_registration.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: bundle_recipient_code (required) - string - Bundle recipient code.
Instance Method Summary collapse
-
#bundle_recipient_code ⇒ Object
string - Bundle recipient code.
- #bundle_recipient_code=(value) ⇒ Object
-
#bundle_registration_code ⇒ Object
string - If the recipient has already registered for this bundle, this is their registration code to get the bundle contents.
- #bundle_registration_code=(value) ⇒ Object
-
#code ⇒ Object
string - The bundle recipient registration code.
- #code=(value) ⇒ Object
-
#company ⇒ Object
string - The recipient's company.
- #company=(value) ⇒ Object
-
#inbox_code ⇒ Object
string - InboxRegistration cookie code, if there is an associated InboxRegistration.
- #inbox_code=(value) ⇒ Object
-
#initialize(attributes = {}, options = {}) ⇒ BundleRecipientRegistration
constructor
A new instance of BundleRecipientRegistration.
-
#name ⇒ Object
string - The recipient's name.
- #name=(value) ⇒ Object
-
#password_emailed ⇒ Object
boolean - Whether a one-time password was emailed to the recipient.
- #password_emailed=(value) ⇒ Object
-
#recipient ⇒ Object
string - The recipient's email address.
- #recipient=(value) ⇒ Object
- #save ⇒ Object
Constructor Details
#initialize(attributes = {}, options = {}) ⇒ BundleRecipientRegistration
Returns a new instance of BundleRecipientRegistration.
7 8 9 10 |
# File 'lib/files.com/models/bundle_recipient_registration.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/bundle_recipient_registration.rb', line 5 def attributes @attributes end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 5 def @options end |
Class Method Details
.create(params = {}, options = {}) ⇒ Object
Parameters:
bundle_recipient_code (required) - string - Bundle recipient code
97 98 99 100 101 102 103 |
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 97 def self.create(params = {}, = {}) raise InvalidParameterError.new("Bad parameter: bundle_recipient_code must be an String") if params[:bundle_recipient_code] and !params[:bundle_recipient_code].is_a?(String) raise MissingParameterError.new("Parameter missing: bundle_recipient_code") unless params[:bundle_recipient_code] response, = Api.send_request("/bundle_recipient_registrations", :post, params, ) BundleRecipientRegistration.new(response.data, ) end |
Instance Method Details
#bundle_recipient_code ⇒ Object
string - Bundle recipient code
76 77 78 |
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 76 def bundle_recipient_code @attributes[:bundle_recipient_code] end |
#bundle_recipient_code=(value) ⇒ Object
80 81 82 |
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 80 def bundle_recipient_code=(value) @attributes[:bundle_recipient_code] = value end |
#bundle_registration_code ⇒ Object
string - If the recipient has already registered for this bundle, this is their registration code to get the bundle contents.
22 23 24 |
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 22 def bundle_registration_code @attributes[:bundle_registration_code] end |
#bundle_registration_code=(value) ⇒ Object
26 27 28 |
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 26 def bundle_registration_code=(value) @attributes[:bundle_registration_code] = value end |
#code ⇒ Object
string - The bundle recipient registration code. Use this to register for the bundle.
13 14 15 |
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 13 def code @attributes[:code] end |
#code=(value) ⇒ Object
17 18 19 |
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 17 def code=(value) @attributes[:code] = value end |
#company ⇒ Object
string - The recipient's company.
49 50 51 |
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 49 def company @attributes[:company] end |
#company=(value) ⇒ Object
53 54 55 |
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 53 def company=(value) @attributes[:company] = value end |
#inbox_code ⇒ Object
string - InboxRegistration cookie code, if there is an associated InboxRegistration
67 68 69 |
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 67 def inbox_code @attributes[:inbox_code] end |
#inbox_code=(value) ⇒ Object
71 72 73 |
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 71 def inbox_code=(value) @attributes[:inbox_code] = value end |
#name ⇒ Object
string - The recipient's name.
40 41 42 |
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 40 def name @attributes[:name] end |
#name=(value) ⇒ Object
44 45 46 |
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 44 def name=(value) @attributes[:name] = value end |
#password_emailed ⇒ Object
boolean - Whether a one-time password was emailed to the recipient.
58 59 60 |
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 58 def password_emailed @attributes[:password_emailed] end |
#password_emailed=(value) ⇒ Object
62 63 64 |
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 62 def password_emailed=(value) @attributes[:password_emailed] = value end |
#recipient ⇒ Object
string - The recipient's email address.
31 32 33 |
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 31 def recipient @attributes[:recipient] end |
#recipient=(value) ⇒ Object
35 36 37 |
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 35 def recipient=(value) @attributes[:recipient] = value end |
#save ⇒ Object
84 85 86 87 88 89 90 91 92 93 |
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 84 def save if @attributes[:id] raise NotImplementedError.new("The BundleRecipientRegistration object doesn't support updates.") else new_obj = BundleRecipientRegistration.create(@attributes, @options) end @attributes = new_obj.attributes true end |