Sha256: cb48712bb44c0d95e19ff6b87cd3971c29969f313e3cf6198349e4c65af0b3c4
Contents?: true
Size: 674 Bytes
Versions: 17
Compression:
Stored size: 674 Bytes
Contents
require 'json' module Fitting class Records class Spherical class Response attr_reader :status, :body def initialize(status:, body:) @status = status @body = body end def to_hash { status: status, body: JSON.load(body) } rescue JSON::ParserError { status: status, body: {} } end def to_json JSON.dump(to_hash) end class << self def load(hash) new(status: hash['status'], body: hash['body']) end end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems