Sha256: c3f5e30623de302515411aa26d6cd58892091a93186b6dc340297b3ecf686db1

Contents?: true

Size: 812 Bytes

Versions: 12

Compression:

Stored size: 812 Bytes

Contents

# frozen_string_literal: true
module TopsConnect
  module Communities
    # Method: GET
    # Endpoint: Community_GetList
    # Returns: Array<TopsConnect::Community>
    def communities
      get('/community').map do |community_data|
        TopsConnect::Community.new community_data
      end
    end

    # Method: GET
    # Endpoint: Community_Get
    # Returns: TopsConnect::Community
    def community
      TopsConnect::Community.new get("/community/#{@community_id}")
    end

    # Method: GET
    # Endpoint: ChargeCode_GetList
    # Returns: Array<Hash>
    def charge_codes
      get('/chargecode').map do |charge_code|
        {
          key: charge_code['ChargeCodeKey'],
          code: charge_code['Code'],
          description: charge_code['Description']
        }
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
tops_connect-0.4.3.2 lib/tops_connect/communities.rb
tops_connect-0.4.3.1 lib/tops_connect/communities.rb
tops_connect-0.4.3 lib/tops_connect/communities.rb
tops_connect-0.4.2.1 lib/tops_connect/communities.rb
tops_connect-0.4.2 lib/tops_connect/communities.rb
tops_connect-0.4.1 lib/tops_connect/communities.rb
tops_connect-0.4.0 lib/tops_connect/communities.rb
tops_connect-0.3.4 lib/tops_connect/communities.rb
tops_connect-0.3.3 lib/tops_connect/communities.rb
tops_connect-0.3.2 lib/tops_connect/communities.rb
tops_connect-0.3.1 lib/tops_connect/communities.rb
tops_connect-0.3.0 lib/tops_connect/communities.rb