Class: Monolens::Type::Object

Inherits:
Object
  • Object
show all
Extended by:
ErrorHandling
Defined in:
lib/monolens/type/object.rb

Class Method Summary collapse

Methods included from ErrorHandling

fail!

Class Method Details

.===(instance) ⇒ Object



12
13
14
# File 'lib/monolens/type/object.rb', line 12

def self.===(instance)
  instance.is_a?(::Hash)
end

.dress(instance, registry, &block) ⇒ Object



6
7
8
9
10
# File 'lib/monolens/type/object.rb', line 6

def self.dress(instance, registry, &block)
  fail!("Object expected, got #{instance.class}", &block) unless instance.is_a?(::Hash)

  instance
end