Sha256: 809b49646c3476cb0d745d385a8872e06244d8e707f7fdb48b81de0a0c204ec4

Contents?: true

Size: 850 Bytes

Versions: 2

Compression:

Stored size: 850 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'],
          name: charge_code['Name']
        }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tops_connect-0.6.3 lib/tops_connect/communities.rb
tops_connect-0.6.2 lib/tops_connect/communities.rb