Class: Literal::Either Abstract

Inherits:
Object
  • Object
show all
Extended by:
Modifiers
Defined in:
lib/literal/either.rb

Overview

This class is abstract.

Direct Known Subclasses

Left, Right

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Modifiers

extended

Constructor Details

#initialize(value) ⇒ Either

Returns a new instance of Either.



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

def initialize(value)
	@value = value
	freeze
end

Instance Attribute Details

#typeObject

Returns the value of attribute type.



35
36
37
# File 'lib/literal/either.rb', line 35

def type
  @type
end

#valueObject (readonly)

Returns the value of attribute value.



34
35
36
# File 'lib/literal/either.rb', line 34

def value
  @value
end

Instance Method Details

#inspectString

Returns:

  • (String)


16
# File 'lib/literal/either.rb', line 16

abstract def inspect = nil

#leftLiteral::Either

Returns:



28
# File 'lib/literal/either.rb', line 28

abstract def left = nil

#left?Boolean

Returns:

  • (Boolean)


20
# File 'lib/literal/either.rb', line 20

abstract def left? = nil

#rightLiteral::Either

Returns:



32
# File 'lib/literal/either.rb', line 32

abstract def right = nil

#right?Boolean

Returns:

  • (Boolean)


24
# File 'lib/literal/either.rb', line 24

abstract def right? = nil