Class: Curlify
- Inherits:
-
Object
- Object
- Curlify
- Defined in:
- lib/curlify.rb
Instance Attribute Summary collapse
-
#compressed ⇒ Object
readonly
Returns the value of attribute compressed.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#verify ⇒ Object
readonly
Returns the value of attribute verify.
Instance Method Summary collapse
-
#initialize(request, compressed: false, verify: true) ⇒ Curlify
constructor
A new instance of Curlify.
- #to_curl ⇒ Object
Constructor Details
#initialize(request, compressed: false, verify: true) ⇒ Curlify
Returns a new instance of Curlify.
8 9 10 11 12 |
# File 'lib/curlify.rb', line 8 def initialize(request, compressed: false, verify: true) @request = request @compressed = compressed @verify = verify end |
Instance Attribute Details
#compressed ⇒ Object (readonly)
Returns the value of attribute compressed.
6 7 8 |
# File 'lib/curlify.rb', line 6 def compressed @compressed end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
6 7 8 |
# File 'lib/curlify.rb', line 6 def request @request end |
#verify ⇒ Object (readonly)
Returns the value of attribute verify.
6 7 8 |
# File 'lib/curlify.rb', line 6 def verify @verify end |
Instance Method Details
#to_curl ⇒ Object
14 15 16 17 18 19 |
# File 'lib/curlify.rb', line 14 def to_curl return "#{curl_request} --compressed" if compressed return "#{curl_request} --insecure" unless verify curl_request end |