Class: CassetteRack::Decorator::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/cassette-rack/decorator/request.rb

Instance Method Summary collapse

Constructor Details

#initialize(request) ⇒ Request

Returns a new instance of Request.



4
5
6
# File 'lib/cassette-rack/decorator/request.rb', line 4

def initialize(request)
  @request = request
end

Instance Method Details

#methodObject



15
16
17
# File 'lib/cassette-rack/decorator/request.rb', line 15

def method
  @request.method.to_s.upcase
end

#pathObject



19
20
21
# File 'lib/cassette-rack/decorator/request.rb', line 19

def path
  URI.parse(@request.uri).path
end

#to_liquidObject



8
9
10
11
12
13
# File 'lib/cassette-rack/decorator/request.rb', line 8

def to_liquid
  {
    'method' => method,
    'path' => path
  }
end