Class: GrowViral::Warehouse::ChecksFollowHistory
- Inherits:
-
Object
- Object
- GrowViral::Warehouse::ChecksFollowHistory
- Defined in:
- lib/warehouse/checks_follow_history.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#following_handle ⇒ Object
readonly
Returns the value of attribute following_handle.
-
#handle ⇒ Object
readonly
Returns the value of attribute handle.
Class Method Summary collapse
Instance Method Summary collapse
- #exists? ⇒ Boolean
-
#initialize(handle, following_handle, deps) ⇒ ChecksFollowHistory
constructor
A new instance of ChecksFollowHistory.
- #uri ⇒ Object
Constructor Details
#initialize(handle, following_handle, deps) ⇒ ChecksFollowHistory
Returns a new instance of ChecksFollowHistory.
9 10 11 12 13 |
# File 'lib/warehouse/checks_follow_history.rb', line 9 def initialize(handle, following_handle, deps) @handle = handle @following_handle = following_handle @config = deps[:config] end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
8 9 10 |
# File 'lib/warehouse/checks_follow_history.rb', line 8 def config @config end |
#following_handle ⇒ Object (readonly)
Returns the value of attribute following_handle.
8 9 10 |
# File 'lib/warehouse/checks_follow_history.rb', line 8 def following_handle @following_handle end |
#handle ⇒ Object (readonly)
Returns the value of attribute handle.
8 9 10 |
# File 'lib/warehouse/checks_follow_history.rb', line 8 def handle @handle end |
Class Method Details
.exists?(*args) ⇒ Boolean
4 5 6 |
# File 'lib/warehouse/checks_follow_history.rb', line 4 def self.exists?(*args) new(*args).exists? end |
Instance Method Details
#exists? ⇒ Boolean
15 16 17 18 19 20 21 22 |
# File 'lib/warehouse/checks_follow_history.rb', line 15 def exists? response = Net::HTTP.get_response(uri) if response.code.to_i == 200 true else false end end |
#uri ⇒ Object
24 25 26 |
# File 'lib/warehouse/checks_follow_history.rb', line 24 def uri @uri ||= URI.parse("#{config.host}/follows?handle=#{handle}&following_handle=#{following_handle}") end |