Class: InlineCssHtmlConverter::Worker
- Inherits:
-
Object
- Object
- InlineCssHtmlConverter::Worker
- Defined in:
- lib/inline-css-html-converter/worker.rb
Constant Summary collapse
- API_VERSION =
'2.0'
Instance Method Summary collapse
-
#initialize(apikey, html) ⇒ Worker
constructor
A new instance of Worker.
- #perform ⇒ Object
Constructor Details
#initialize(apikey, html) ⇒ Worker
Returns a new instance of Worker.
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/inline-css-html-converter/worker.rb', line 7 def initialize(apikey, html) raise NoApiKeyGivenError if apikey.nil? @apikey = apikey @html = html if apikey.split('-').length == 2 @host = "https://#{apikey.split('-')[1]}.api.mailchimp.com/#{API_VERSION}" else raise InvalidApiKeyError, 'Your MailChimp API key must contain a suffix subdomain (e.g. "-us8").' end end |
Instance Method Details
#perform ⇒ Object
20 21 22 23 |
# File 'lib/inline-css-html-converter/worker.rb', line 20 def perform result = call_mailchimp result['html'] end |