Module: SnipSnap::Client::InstanceMethods
- Defined in:
- lib/snip_snap/client.rb
Instance Attribute Summary collapse
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
Instance Attribute Details
#url ⇒ Object (readonly)
Returns the value of attribute url.
6 7 8 |
# File 'lib/snip_snap/client.rb', line 6 def url @url end |
Instance Method Details
#fetch ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/snip_snap/client.rb', line 16 def fetch client = Curl::Easy.new(url) do |config| config.follow_location = true config.max_redirects = 5 config.head = self.class.head? end client.perform client end |
#image? ⇒ Boolean
12 13 14 |
# File 'lib/snip_snap/client.rb', line 12 def image? true end |
#initialize(url) ⇒ Object
8 9 10 |
# File 'lib/snip_snap/client.rb', line 8 def initialize(url) @url = url end |
#response ⇒ Object
28 29 30 |
# File 'lib/snip_snap/client.rb', line 28 def response @response ||= fetch end |