Class: Webhookdb::OrganizationMembership
- Inherits:
-
Object
- Object
- Webhookdb::OrganizationMembership
- Defined in:
- lib/webhookdb/organization_membership.rb
Constant Summary collapse
- VALID_ROLE_NAMES =
["admin", "member"].freeze
Instance Method Summary collapse
- #admin? ⇒ Boolean
- #customer_email ⇒ Object
- #default? ⇒ Boolean
- #organization_name ⇒ Object
- #status ⇒ Object
- #verified? ⇒ Boolean
Instance Method Details
#admin? ⇒ Boolean
33 34 35 |
# File 'lib/webhookdb/organization_membership.rb', line 33 def admin? return self.membership_role.name == "admin" end |
#customer_email ⇒ Object
20 21 22 |
# File 'lib/webhookdb/organization_membership.rb', line 20 def customer_email return self.customer.email end |
#default? ⇒ Boolean
16 17 18 |
# File 'lib/webhookdb/organization_membership.rb', line 16 def default? return self.is_default end |
#organization_name ⇒ Object
24 25 26 |
# File 'lib/webhookdb/organization_membership.rb', line 24 def organization_name return self.organization.name end |
#status ⇒ Object
28 29 30 31 |
# File 'lib/webhookdb/organization_membership.rb', line 28 def status return "invited" unless self.verified self.membership_role.name end |
#verified? ⇒ Boolean
12 13 14 |
# File 'lib/webhookdb/organization_membership.rb', line 12 def verified? return self.verified end |