Class: Faraday::Adapter::Test::Stub

Inherits:
Struct
  • Object
show all
Defined in:
lib/faraday/adapter/test.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Instance Attribute Details

- (Object) block

Returns the value of attribute block

Returns:

  • (Object)

    the current value of block



87
88
89
# File 'lib/faraday/adapter/test.rb', line 87

def block
  @block
end

- (Object) body

Returns the value of attribute body

Returns:

  • (Object)

    the current value of body



87
88
89
# File 'lib/faraday/adapter/test.rb', line 87

def body
  @body
end

- (Object) path

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



87
88
89
# File 'lib/faraday/adapter/test.rb', line 87

def path
  @path
end

Instance Method Details

- (Boolean) matches?(request_path, request_body)

Returns:

  • (Boolean)


88
89
90
# File 'lib/faraday/adapter/test.rb', line 88

def matches?(request_path, request_body)
  request_path == path && (body.to_s.size.zero? || request_body == body)
end

- (Object) to_s



92
93
94
# File 'lib/faraday/adapter/test.rb', line 92

def to_s
  "#{path} #{body}"
end