Class: GrowViral::Warehouse::FetchesFollowHistory
- Inherits:
-
Object
- Object
- GrowViral::Warehouse::FetchesFollowHistory
- Defined in:
- lib/warehouse/fetches_follow_history.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#uid ⇒ Object
readonly
Returns the value of attribute uid.
Class Method Summary collapse
Instance Method Summary collapse
- #fetch ⇒ Object
-
#initialize(uid, deps) ⇒ FetchesFollowHistory
constructor
A new instance of FetchesFollowHistory.
- #uri ⇒ Object
Constructor Details
#initialize(uid, deps) ⇒ FetchesFollowHistory
Returns a new instance of FetchesFollowHistory.
9 10 11 12 13 14 |
# File 'lib/warehouse/fetches_follow_history.rb', line 9 def initialize(uid, deps) raise HandleNotUidError unless uid.is_a? Numeric @uid = uid @config = deps[:config] end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
8 9 10 |
# File 'lib/warehouse/fetches_follow_history.rb', line 8 def config @config end |
#uid ⇒ Object (readonly)
Returns the value of attribute uid.
8 9 10 |
# File 'lib/warehouse/fetches_follow_history.rb', line 8 def uid @uid end |
Class Method Details
.fetch(*args) ⇒ Object
4 5 6 |
# File 'lib/warehouse/fetches_follow_history.rb', line 4 def self.fetch(*args) new(*args).fetch end |
Instance Method Details
#fetch ⇒ Object
16 17 18 19 |
# File 'lib/warehouse/fetches_follow_history.rb', line 16 def fetch response = Net::HTTP.get_response(uri) JSON.parse(response.body) end |
#uri ⇒ Object
21 22 23 |
# File 'lib/warehouse/fetches_follow_history.rb', line 21 def uri @uri ||= URI.parse("#{config.host}/follow_history?uid=#{uid}") end |