Class: Postwill::Client
- Inherits:
-
Object
- Object
- Postwill::Client
- Defined in:
- lib/postwill/client.rb
Constant Summary collapse
- PROVIDERS =
%i[twitter facebook pinterest tumblr instagram]
Instance Method Summary collapse
-
#initialize(data) ⇒ Client
constructor
A new instance of Client.
- #to(providers, options = {}) ⇒ Object
Constructor Details
#initialize(data) ⇒ Client
Returns a new instance of Client.
5 6 7 |
# File 'lib/postwill/client.rb', line 5 def initialize(data) instance_providers(data) end |
Instance Method Details
#to(providers, options = {}) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/postwill/client.rb', line 9 def to(providers, = {}) availables_providers(providers).each_with_object({}) do |provider, result| provider_service = instance_variable_get("@#{provider}") result[provider] = response(provider_service.call()) end end |