Class: Monolens::Type::String

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

Class Method Summary collapse

Methods included from ErrorHandling

fail!

Class Method Details

.===(instance) ⇒ Object



7
8
9
# File 'lib/monolens/type/string.rb', line 7

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

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



11
12
13
14
15
# File 'lib/monolens/type/string.rb', line 11

def self.dress(instance, registry, &block)
  fail!("Invalid string #{instance}", &block) unless self === instance

  instance
end