lib/acfs/request.rb in acfs-1.5.1 vs lib/acfs/request.rb in acfs-1.6.0
- old
+ new
@@ -9,11 +9,11 @@
class Request
attr_accessor :body, :format
attr_reader :url, :headers, :params, :data, :method, :operation
include Request::Callbacks
- def initialize(url, options = {}, &block)
+ def initialize(url, **options, &block)
@url = URI.parse(url.to_s).tap do |_url|
@data = options.delete(:data) || nil
@format = options.delete(:format) || :json
@headers = options.delete(:headers) || {}
@params = options.delete(:params) || {}
@@ -25,16 +25,8 @@
on_complete(&block) if block_given?
end
def data?
!data.nil?
- end
-
- class << self
- def new(*attrs)
- return attrs[0] if attrs[0].is_a? self
-
- super
- end
end
end
end