class RestMyCase::Context::Base

Public Class Methods

error_class() click to toggle source
# File lib/rest_my_case/context/base.rb, line 13
def self.error_class
  Errors::Base
end
schema_validator_class() click to toggle source
# File lib/rest_my_case/context/base.rb, line 17
def self.schema_validator_class
  SchemaValidator::Base
end

Public Instance Methods

errors() click to toggle source
# File lib/rest_my_case/context/base.rb, line 33
def errors
  @errors ||= self.class.error_class.new(self)
end
ok?()
Also aliased as: success?
Alias for: valid?
success?()
Alias for: ok?
to_hash() click to toggle source
# File lib/rest_my_case/context/base.rb, line 25
def to_hash
  Marshal.load Marshal.dump(attributes)
end
valid?() click to toggle source
# File lib/rest_my_case/context/base.rb, line 37
def valid?
  errors.empty?
end
Also aliased as: ok?
validate_schema(schema) click to toggle source
# File lib/rest_my_case/context/base.rb, line 29
def validate_schema(schema)
  self.class.schema_validator_class.new(self).validate(schema)
end
values_at(*keys) click to toggle source
# File lib/rest_my_case/context/base.rb, line 21
def values_at(*keys)
  attributes.values_at(*keys)
end