class Fragmentary::Request

Attributes

method[R]
options[R]
parameters[R]
path[R]

Public Class Methods

new(method, path, parameters=nil, options=nil) click to toggle source
# File lib/fragmentary/request.rb, line 6
def initialize(method, path, parameters=nil, options=nil)
  @method, @path, @parameters, @options = method, path, parameters, options
end

Public Instance Methods

==(other) click to toggle source
# File lib/fragmentary/request.rb, line 10
def ==(other)
  method == other.method and path == other.path and parameters == other.parameters and options == other.options
end
to_proc() click to toggle source
# File lib/fragmentary/request.rb, line 14
def to_proc
  method = @method; path = @path; parameters = @parameters; options = @options.try :dup
  if @options.try(:[], :xhr)
    Proc.new do
      puts "      * Sending xhr request '#{method.to_s} #{path}'" + (!parameters.nil? ? " with #{parameters.inspect}" : "")
      send(:xhr, method, path, parameters, options)
    end
  else
    Proc.new do
      puts "      * Sending request '#{method.to_s} #{path}'" + (!parameters.nil? ? " with #{parameters.inspect}" : "")
      send(method, path, parameters, options)
    end
  end
end