Class: Literal::Failure::Generic

Inherits:
Object
  • Object
show all
Includes:
Type
Defined in:
lib/literal/failure.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Type

#<=, #>=

Constructor Details

#initialize(type) ⇒ Generic

Returns a new instance of Generic.



7
8
9
10
# File 'lib/literal/failure.rb', line 7

def initialize(type)
  @type = type
  freeze
end

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



12
13
14
# File 'lib/literal/failure.rb', line 12

def type
  @type
end

Instance Method Details

#===(object) ⇒ Object



14
15
16
# File 'lib/literal/failure.rb', line 14

def ===(object)
  Literal::Failure === object && @type === object.error!
end

#inspectObject



18
19
20
# File 'lib/literal/failure.rb', line 18

def inspect
  "Literal::Failure(#{@type.inspect})"
end