Sha256: bd147017e1234e716e5c0f815465fbffa107466fcc36374b4b8b7ee8986713f3
Contents?: true
Size: 1.1 KB
Versions: 17
Compression:
Stored size: 1.1 KB
Contents
require 'json' require 'fitting/records/spherical/response' module Fitting class Records class Spherical class Request attr_reader :method, :path, :body, :response, :title, :group def initialize(method:, path:, body:, response:, title:, group:) @method = method @path = path @body = body @response = response @title = title @group = group end def to_hash { method: method, path: path.to_s, body: body, response: response.to_hash, title: title, group: group } end def to_json JSON.dump(to_hash) end class << self def load(hash) new( method: hash['method'], path: hash['path'], body: hash['body'], response: Fitting::Records::Spherical::Response.load(hash['response']), title: hash['title'], group: hash['group'] ) end end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems