Sha256: 7527173a74fb88d51761025221d3ce8f6c8f8de0eb8d489c89a1711cf5b2444a

Contents?: true

Size: 451 Bytes

Versions: 8

Compression:

Stored size: 451 Bytes

Contents

module Helium
  class Organization < Resource
    attr_reader :name, :timezone

    def initialize(opts = {})
      super(opts)

      @name     = @params.dig('attributes', 'name')
      @timezone = @params.dig('attributes', 'timezone')
    end

    # TODO refactor into relationships
    def users
      @client.organization_users
    end

    def as_json
      super.merge({
        name: name,
        timezone: timezone
      })
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
helium-ruby-0.12.0 lib/helium/organization.rb
helium-ruby-0.11.0 lib/helium/organization.rb
helium-ruby-0.10.0 lib/helium/organization.rb
helium-ruby-0.9.0 lib/helium/organization.rb
helium-ruby-0.8.0 lib/helium/organization.rb
helium-ruby-0.7.0 lib/helium/organization.rb
helium-ruby-0.6.0 lib/helium/organization.rb
helium-ruby-0.5.0 lib/helium/organization.rb