Class: Rflak::Traker
Overview
Utility class to fetch entries from flaker.pl traker service
Example:
Traker.fetch do |traker|
traker.url 'http://blog.sebastiannowak.net'
traker.limit 20
end
Constant Summary collapse
- FLAK_API_URL =
'http://api.flaker.pl/api/type:traker'
Instance Attribute Summary collapse
-
#perform_url ⇒ Object
readonly
Returns the value of attribute perform_url.
Class Method Summary collapse
Instance Method Summary collapse
- #avatars(size) ⇒ Object
- #format(format) ⇒ Object
-
#initialize ⇒ Traker
constructor
A new instance of Traker.
- #limit(value) ⇒ Object
- #url(url) ⇒ Object
Constructor Details
#initialize ⇒ Traker
Returns a new instance of Traker.
20 21 22 |
# File 'lib/traker.rb', line 20 def initialize @perform_url = FLAK_API_URL end |
Instance Attribute Details
#perform_url ⇒ Object (readonly)
Returns the value of attribute perform_url.
18 19 20 |
# File 'lib/traker.rb', line 18 def perform_url @perform_url end |
Class Method Details
Instance Method Details
#avatars(size) ⇒ Object
42 43 44 |
# File 'lib/traker.rb', line 42 def avatars(size) @perform_url += "/avatars:#{ size }" end |
#format(format) ⇒ Object
37 38 39 |
# File 'lib/traker.rb', line 37 def format(format) @perform_url += "/format:#{ format }" end |
#limit(value) ⇒ Object
47 48 49 |
# File 'lib/traker.rb', line 47 def limit(value) @perform_url += "/limit:#{ value }" end |
#url(url) ⇒ Object
32 33 34 |
# File 'lib/traker.rb', line 32 def url(url) @perform_url += "/url:#{ url }" end |