Class: Fotolia::Countries

Inherits:
Object
  • Object
show all
Defined in:
lib/fotolia/countries.rb

Overview

Fetches all countries known to Fotolia from its API.

You may use Fotolia::Base#countries as shortcut to an instance of this class.

Instance Method Summary collapse

Constructor Details

#initialize(fotolia_client) ⇒ Countries

Returns a new instance of Countries.



8
9
10
# File 'lib/fotolia/countries.rb', line 8

def initialize(fotolia_client)
  @fotolia = fotolia_client
end

Instance Method Details

#find_allObject

Returns an array of Fotolia::Country objects.



15
16
17
18
19
# File 'lib/fotolia/countries.rb', line 15

def find_all
  rsp = @fotolia.remote_call('getCountries', @fotolia.language.id)

  rsp.collect{|c| Fotolia::Country.new(c)}
end