Class: Spaceship::Portal::Invite
- Inherits:
-
Spaceship::PortalBase
- Object
- Base
- Spaceship::PortalBase
- Spaceship::Portal::Invite
- Defined in:
- spaceship/lib/spaceship/portal/invite.rb
Instance Attribute Summary collapse
-
#created ⇒ String
Invite creation date.
-
#email_address ⇒ String
Recipient Email Address.
-
#expires ⇒ String
Invite expiration date.
-
#invite_id ⇒ String
Invite Id.
-
#inviter_name ⇒ String
Inviter name.
-
#type ⇒ String
Role (member, admin or agent).
Attributes inherited from Base
Class Method Summary collapse
Methods inherited from Spaceship::PortalBase
Methods inherited from Base
attr_accessor, attr_mapping, #attributes, attributes, #initialize, #inspect, mapping_module, method_missing, set_client, #setup, #to_s
Constructor Details
This class inherits a constructor from Spaceship::Base
Instance Attribute Details
#created ⇒ String
Returns Invite creation date.
19 20 21 |
# File 'spaceship/lib/spaceship/portal/invite.rb', line 19 def created @created end |
#email_address ⇒ String
Returns Recipient Email Address.
13 14 15 |
# File 'spaceship/lib/spaceship/portal/invite.rb', line 13 def email_address @email_address end |
#expires ⇒ String
Returns Invite expiration date.
22 23 24 |
# File 'spaceship/lib/spaceship/portal/invite.rb', line 22 def expires @expires end |
#invite_id ⇒ String
Returns Invite Id.
7 8 9 |
# File 'spaceship/lib/spaceship/portal/invite.rb', line 7 def invite_id @invite_id end |
#inviter_name ⇒ String
Returns Inviter name.
10 11 12 |
# File 'spaceship/lib/spaceship/portal/invite.rb', line 10 def inviter_name @inviter_name end |
#type ⇒ String
Returns Role (member, admin or agent).
16 17 18 |
# File 'spaceship/lib/spaceship/portal/invite.rb', line 16 def type @type end |
Class Method Details
.factory(attrs) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'spaceship/lib/spaceship/portal/invite.rb', line 34 def factory(attrs) begin attrs['dateCreated'] = Time.at(attrs['dateCreated'] / 1000).utc rescue NoMethodError # if attrs['dateCreated'] does not implement / rescue TypeError # if Time.at receives an invalid type end begin attrs['dateExpires'] = Time.at(attrs['dateExpires'] / 1000).utc rescue NoMethodError rescue TypeError end attrs['recipientRole'] = attrs['recipientRole'].downcase return self.new(attrs) end |