Method: AccessGrid::AccessCards#list

Defined in:
lib/accessgrid/access_cards.rb

#list(template_id, state = nil) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/accessgrid/access_cards.rb', line 26

def list(template_id, state = nil)
  params = { template_id: template_id }
  params[:state] = state if state
  
  response = @client.make_request(:get, '/v1/key-cards', nil, params)
  response.fetch('keys', []).map { |item| Card.new(item) }
end