Class: Spaceship::Portal::Person
- Inherits:
-
Spaceship::PortalBase
- Object
- Base
- Spaceship::PortalBase
- Spaceship::Portal::Person
- Defined in:
- spaceship/lib/spaceship/portal/person.rb
Instance Attribute Summary collapse
-
#developer_status ⇒ String
Developer status (active, inactive).
-
#email_address ⇒ String
Email Address.
-
#firstname ⇒ String
First name.
-
#joined ⇒ String
Joined Date.
-
#lastname ⇒ String
Last name.
-
#person_id ⇒ String
Person Id.
-
#team_member_id ⇒ String
Id in Team scope.
-
#type ⇒ String
Role (member, admin or agent).
Attributes inherited from Base
Class Method Summary collapse
Instance 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
#developer_status ⇒ String
Returns Developer status (active, inactive).
19 20 21 |
# File 'spaceship/lib/spaceship/portal/person.rb', line 19 def developer_status @developer_status end |
#email_address ⇒ String
Returns Email Address.
16 17 18 |
# File 'spaceship/lib/spaceship/portal/person.rb', line 16 def email_address @email_address end |
#firstname ⇒ String
Returns First name.
10 11 12 |
# File 'spaceship/lib/spaceship/portal/person.rb', line 10 def firstname @firstname end |
#joined ⇒ String
Returns Joined Date.
22 23 24 |
# File 'spaceship/lib/spaceship/portal/person.rb', line 22 def joined @joined end |
#lastname ⇒ String
Returns Last name.
13 14 15 |
# File 'spaceship/lib/spaceship/portal/person.rb', line 13 def lastname @lastname end |
#person_id ⇒ String
Returns Person Id.
7 8 9 |
# File 'spaceship/lib/spaceship/portal/person.rb', line 7 def person_id @person_id end |
#team_member_id ⇒ String
Returns Id in Team scope.
25 26 27 |
# File 'spaceship/lib/spaceship/portal/person.rb', line 25 def team_member_id @team_member_id end |
#type ⇒ String
Returns Role (member, admin or agent).
28 29 30 |
# File 'spaceship/lib/spaceship/portal/person.rb', line 28 def type @type end |
Class Method Details
.factory(attrs) ⇒ Object
49 50 51 52 53 54 55 56 57 58 |
# File 'spaceship/lib/spaceship/portal/person.rb', line 49 def factory(attrs) begin attrs['dateJoined'] = Time.parse(attrs['dateJoined']) rescue TypeError # Raised if we start getting integer timestamps rescue ArgumentError # Raised if the string's format can't be parsed end return self.new(attrs) end |
Instance Method Details
#change_role(role) ⇒ Object
44 45 46 |
# File 'spaceship/lib/spaceship/portal/person.rb', line 44 def change_role(role) client.team_set_role(team_member_id, role) end |
#remove! ⇒ Object
40 41 42 |
# File 'spaceship/lib/spaceship/portal/person.rb', line 40 def remove! client.team_remove_member!(team_member_id) end |