Class: Tinyletter::Newsletter
- Inherits:
-
Object
- Object
- Tinyletter::Newsletter
- Defined in:
- lib/tinyletter/newsletter.rb
Constant Summary collapse
- BASE_ENDPOINT =
'http://tinyletter.com/'.freeze
Instance Method Summary collapse
-
#initialize(username, params = {}) ⇒ Newsletter
constructor
A new instance of Newsletter.
- #metadata ⇒ Object
Constructor Details
#initialize(username, params = {}) ⇒ Newsletter
Returns a new instance of Newsletter.
11 12 13 14 15 |
# File 'lib/tinyletter/newsletter.rb', line 11 def initialize(username, params = {}) @username = username @with_archive = params[:with_archive] || false initialize_http_client end |
Instance Method Details
#metadata ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/tinyletter/newsletter.rb', line 17 def return unless .nil? begin page = get(BASE_ENDPOINT + @username) = (page) rescue Mechanize::ResponseCodeError => e { error: e } end end |