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

#blockObject

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

#bodyObject

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

#pathObject

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

#matches?(request_path, request_body) ⇒ Boolean

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

#to_sObject



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

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