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
39 40 41 |
# File 'lib/webhookdb/organization_membership.rb', line 39 def admin? return self.membership_role.name == "admin" end |
#customer_email ⇒ Object
26 27 28 |
# File 'lib/webhookdb/organization_membership.rb', line 26 def customer_email return self.customer.email end |
#default? ⇒ Boolean
22 23 24 |
# File 'lib/webhookdb/organization_membership.rb', line 22 def default? return self.is_default end |
#organization_name ⇒ Object
30 31 32 |
# File 'lib/webhookdb/organization_membership.rb', line 30 def organization_name return self.organization.name end |
#status ⇒ Object
34 35 36 37 |
# File 'lib/webhookdb/organization_membership.rb', line 34 def status return "invited" unless self.verified self.membership_role.name end |
#verified? ⇒ Boolean
18 19 20 |
# File 'lib/webhookdb/organization_membership.rb', line 18 def verified? return self.verified end |