Class: Realize::Value::Static

Inherits:
Object
  • Object
show all
Defined in:
lib/realize/value/static.rb

Overview

Transformer that always returns a static value

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value: nil) ⇒ Static

Returns a new instance of Static.



18
19
20
21
22
# File 'lib/realize/value/static.rb', line 18

def initialize(value: nil)
  @value = value

  freeze
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



16
17
18
# File 'lib/realize/value/static.rb', line 16

def value
  @value
end

Instance Method Details

#transform(_resolver, _value, _time, _record) ⇒ Object



24
25
26
# File 'lib/realize/value/static.rb', line 24

def transform(_resolver, _value, _time, _record)
  value
end