Sha256: 7684fb9484bb9924bb565f5caaea44d76341411b0c7c54d80b05684d0965b58e
Contents?: true
Size: 1.1 KB
Versions: 3
Compression:
Stored size: 1.1 KB
Contents
module MrVideo class Episode attr_reader :cassette def initialize(cassette, http_interaction) @cassette = cassette @http_interaction = http_interaction end def id @id ||= IdService.encode(url) end def request_method request['method'] end def url request['uri'] end def website_url @website_url ||= "#{uri.scheme}://#{uri.host}" end def content response['body']['string'] end def content_type headers['content-type'][0] end def recorded_at Time.zone.parse(http_interaction['recorded_at'].to_s).to_datetime end def destroy cassette.send(:destroy_episode, self) end def inspect to_s end def to_param id.to_s end private def request http_interaction['request'] end def response http_interaction['response'] end def headers @headers ||= response['headers'].transform_keys(&:downcase) end def uri @uri ||= URI(url) end def http_interaction @http_interaction end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
mr_video-1.2.0 | app/models/mr_video/episode.rb |
mr_video-1.1.3 | app/models/mr_video/episode.rb |
mr_video-1.1.1 | app/models/mr_video/episode.rb |