Sha256: 258ad3c221ceff37e71cc606b09d6fbab7c900230ff926f43fc256ebb8965872

Contents?: true

Size: 482 Bytes

Versions: 1

Compression:

Stored size: 482 Bytes

Contents

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

    def initialize(client:, params:)
      super(client: client, params: params)

      @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

1 entries across 1 versions & 1 rubygems

Version Path
helium-ruby-0.4.0 lib/helium/organization.rb