Class: Wolflow::Operators::Literal

Inherits:
Base
  • Object
show all
Defined in:
lib/wolflow/operators/literal.rb

Instance Method Summary collapse

Methods inherited from Base

from_hash, inherited

Constructor Details

#initialize(value:, **args) ⇒ Literal

Returns a new instance of Literal.



6
7
8
9
# File 'lib/wolflow/operators/literal.rb', line 6

def initialize(value:, **args)
  @value = value
  super(**args)
end

Instance Method Details

#callObject



11
12
13
# File 'lib/wolflow/operators/literal.rb', line 11

def call(*)
  @value
end

#to_hashObject



15
16
17
18
19
# File 'lib/wolflow/operators/literal.rb', line 15

def to_hash
  hs = super
  hs[:value] = @value
  hs
end