Module: TopsConnect::Communities

Included in:
Client
Defined in:
lib/tops_connect/communities.rb

Instance Method Summary collapse

Instance Method Details

#charge_codesObject

Method: GET Endpoint: ChargeCode_GetList Returns: Array<Hash>



27
28
29
30
31
32
33
34
35
36
# File 'lib/tops_connect/communities.rb', line 27

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

#communitiesObject

Method: GET Endpoint: Community_GetList Returns: Array<TopsConnect::Community>



11
12
13
14
15
# File 'lib/tops_connect/communities.rb', line 11

def communities
  get('/community').map do |community_data|
    TopsConnect::Community.new community_data
  end
end

#communityObject

Method: GET Endpoint: Community_Get Returns: TopsConnect::Community



20
21
22
# File 'lib/tops_connect/communities.rb', line 20

def community
  TopsConnect::Community.new get("/community/#{@community_id}")
end