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



74
75
76
# File 'lib/faraday/adapter/test.rb', line 74

def block
  @block
end

#bodyObject

Returns the value of attribute body

Returns:

  • (Object)

    the current value of body



74
75
76
# File 'lib/faraday/adapter/test.rb', line 74

def body
  @body
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



74
75
76
# File 'lib/faraday/adapter/test.rb', line 74

def path
  @path
end

Instance Method Details

#matches?(request_path, request_body) ⇒ Boolean

Returns:

  • (Boolean)


75
76
77
# File 'lib/faraday/adapter/test.rb', line 75

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

#to_sObject



79
80
81
# File 'lib/faraday/adapter/test.rb', line 79

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