Class: GiftRocket::Recipient
- Inherits:
-
Object
- Object
- GiftRocket::Recipient
- Defined in:
- lib/gift_rocket/recipient.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
Returns the value of attribute email.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(options) ⇒ Recipient
constructor
A new instance of Recipient.
- #params ⇒ Object
Constructor Details
#initialize(options) ⇒ Recipient
Returns a new instance of Recipient.
8 9 10 11 12 13 14 15 |
# File 'lib/gift_rocket/recipient.rb', line 8 def initialize() @name = [:name] @email = [:email] raise GiftRocket::Error::MissingRecipientEmail.new('Recipient email not specified') if @email.nil? || @email.empty? raise GiftRocket::Error::MissingRecipientName.new('Recipient name not specified') if @name.nil? || @name.empty? end |
Instance Attribute Details
#email ⇒ Object
Returns the value of attribute email.
3 4 5 |
# File 'lib/gift_rocket/recipient.rb', line 3 def email @email end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/gift_rocket/recipient.rb', line 3 def name @name end |
Instance Method Details
#params ⇒ Object
17 18 19 |
# File 'lib/gift_rocket/recipient.rb', line 17 def params {'gift[recipient_email]' => @email, 'gift[recipient_name]' => @name} end |