Class: Webhookdb::OrganizationMembership

Inherits:
Object
  • Object
show all
Defined in:
lib/webhookdb/organization_membership.rb

Constant Summary collapse

VALID_ROLE_NAMES =
["admin", "member"].freeze

Instance Method Summary collapse

Instance Method Details

#admin?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/webhookdb/organization_membership.rb', line 39

def admin?
  return self.membership_role.name == "admin"
end

#customer_emailObject



26
27
28
# File 'lib/webhookdb/organization_membership.rb', line 26

def customer_email
  return self.customer.email
end

#default?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/webhookdb/organization_membership.rb', line 22

def default?
  return self.is_default
end

#organization_nameObject



30
31
32
# File 'lib/webhookdb/organization_membership.rb', line 30

def organization_name
  return self.organization.name
end

#statusObject



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

Returns:

  • (Boolean)


18
19
20
# File 'lib/webhookdb/organization_membership.rb', line 18

def verified?
  return self.verified
end