Class: Pocolog::Upgrade::Ops::ContainerCast
- Defined in:
- lib/pocolog/upgrade/ops/container_cast.rb
Instance Attribute Summary collapse
-
#element_ops ⇒ Object
readonly
Returns the value of attribute element_ops.
Attributes inherited from Base
Instance Method Summary collapse
- #call(target, value) ⇒ Object
-
#initialize(to_type, element_ops) ⇒ ContainerCast
constructor
A new instance of ContainerCast.
Methods inherited from Base
Constructor Details
#initialize(to_type, element_ops) ⇒ ContainerCast
Returns a new instance of ContainerCast
7 8 9 10 |
# File 'lib/pocolog/upgrade/ops/container_cast.rb', line 7 def initialize(to_type, element_ops) super(to_type) @element_ops = element_ops end |
Instance Attribute Details
#element_ops ⇒ Object (readonly)
Returns the value of attribute element_ops
5 6 7 |
# File 'lib/pocolog/upgrade/ops/container_cast.rb', line 5 def element_ops @element_ops end |
Instance Method Details
#call(target, value) ⇒ Object
12 13 14 15 16 |
# File 'lib/pocolog/upgrade/ops/container_cast.rb', line 12 def call(target, value) value.raw_each do |sample| target.push(element_ops.convert(sample)) end end |