module Mountapi module Route class Response attr_reader :status # @return [Hash] the JSON API Schema to validate responses against def self.default_schema @default_schema ||= OpenStruct.new({"type" => "object"}.merge( JSON.parse( File.read( File.expand_path("../response/json-api.json", __FILE__) )) )) end def self.build(status, schema = default_schema) new(status, Mountapi::Schema.build(schema)) end def initialize(status, schema) @status = status @schema = schema end def match?(other_status) status.to_s == other_status.to_s end def schema @schema || self.class.default_schema end end end end