Class: WorkOS::Organization
- Inherits:
-
Object
- Object
- WorkOS::Organization
- Includes:
- HashProvider
- Defined in:
- lib/workos/organization.rb
Overview
The Organization class provides a lightweight wrapper around a WorkOS Organization resource. This class is not meant to be instantiated in user space, and is instantiated internally but exposed.
Instance Attribute Summary collapse
-
#allow_profiles_outside_organization ⇒ Object
Returns the value of attribute allow_profiles_outside_organization.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#domains ⇒ Object
Returns the value of attribute domains.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#stripe_customer_id ⇒ Object
Returns the value of attribute stripe_customer_id.
Instance Method Summary collapse
-
#initialize(json) ⇒ Organization
constructor
A new instance of Organization.
- #to_json ⇒ Object
Methods included from HashProvider
Constructor Details
#initialize(json) ⇒ Organization
Returns a new instance of Organization.
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/workos/organization.rb', line 20 def initialize(json) hash = JSON.parse(json, symbolize_names: true) @id = hash[:id] @name = hash[:name] @allow_profiles_outside_organization = hash[:allow_profiles_outside_organization] @domains = hash[:domains] @stripe_customer_id = hash[:stripe_customer_id] @created_at = hash[:created_at] @updated_at = hash[:updated_at] end |
Instance Attribute Details
#allow_profiles_outside_organization ⇒ Object
Returns the value of attribute allow_profiles_outside_organization.
10 11 12 |
# File 'lib/workos/organization.rb', line 10 def allow_profiles_outside_organization @allow_profiles_outside_organization end |
#created_at ⇒ Object
Returns the value of attribute created_at.
10 11 12 |
# File 'lib/workos/organization.rb', line 10 def created_at @created_at end |
#domains ⇒ Object
Returns the value of attribute domains.
10 11 12 |
# File 'lib/workos/organization.rb', line 10 def domains @domains end |
#id ⇒ Object
Returns the value of attribute id.
10 11 12 |
# File 'lib/workos/organization.rb', line 10 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
10 11 12 |
# File 'lib/workos/organization.rb', line 10 def name @name end |
#stripe_customer_id ⇒ Object
Returns the value of attribute stripe_customer_id.
10 11 12 |
# File 'lib/workos/organization.rb', line 10 def stripe_customer_id @stripe_customer_id end |
Instance Method Details
#to_json ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/workos/organization.rb', line 32 def to_json(*) { id: id, name: name, allow_profiles_outside_organization: allow_profiles_outside_organization, domains: domains, stripe_customer_id: stripe_customer_id, created_at: created_at, updated_at: updated_at, } end |