Class: Helium::Organization

Inherits:
Object
  • Object
show all
Defined in:
lib/helium/organization.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:, params:) ⇒ Organization

Returns a new instance of Organization.



5
6
7
8
9
10
11
12
# File 'lib/helium/organization.rb', line 5

def initialize(client:, params:)
  @client     = client
  @id         = params["id"]
  @name       = params["attributes"]["name"]
  @timezone   = params["attributes"]["timezone"]
  @created_at = params["meta"]["created"]
  @updated_at = params["meta"]["updated"]
end

Instance Attribute Details

#created_at ⇒ Object

Returns the value of attribute created_at.



3
4
5
# File 'lib/helium/organization.rb', line 3

def created_at
  @created_at
end

#id ⇒ Object

Returns the value of attribute id.



3
4
5
# File 'lib/helium/organization.rb', line 3

def id
  @id
end

#name ⇒ Object

Returns the value of attribute name.



3
4
5
# File 'lib/helium/organization.rb', line 3

def name
  @name
end

#timezone ⇒ Object

Returns the value of attribute timezone.



3
4
5
# File 'lib/helium/organization.rb', line 3

def timezone
  @timezone
end

#updated_at ⇒ Object

Returns the value of attribute updated_at.



3
4
5
# File 'lib/helium/organization.rb', line 3

def updated_at
  @updated_at
end

Instance Method Details

#users ⇒ Object

TODO refactor into relationships



23
24
25
# File 'lib/helium/organization.rb', line 23

def users
  @client.organization_users
end