Class: Curlify

Inherits:
Object
  • Object
show all
Defined in:
lib/curlify.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request) ⇒ Curlify

Returns a new instance of Curlify.



10
11
12
13
14
15
16
17
# File 'lib/curlify.rb', line 10

def initialize(request)
  @request = request

  Settings.call.each do |key, value|
    instance_variable_set("@#{key}", value)
    define_singleton_method(key) { instance_variable_get("@#{key}") }
  end
end

Instance Attribute Details

#requestObject (readonly)

Returns the value of attribute request.



8
9
10
# File 'lib/curlify.rb', line 8

def request
  @request
end

Instance Method Details

#to_curlObject



19
20
21
22
23
# File 'lib/curlify.rb', line 19

def to_curl
  command = build_curl_command
  copy_to_clipboard(command)
  command
end