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_atObject

Returns the value of attribute created_at



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

def created_at
  @created_at
end

#idObject

Returns the value of attribute id



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

def id
  @id
end

#nameObject

Returns the value of attribute name



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

def name
  @name
end

#timezoneObject

Returns the value of attribute timezone



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

def timezone
  @timezone
end

#updated_atObject

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

#usersObject

TODO refactor into relationships



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

def users
  @client.organization_users
end