Class: Jcsv::RBConvertNilTo

Inherits:
Filter
  • Object
show all
Defined in:
lib/filters.rb

Overview

Instance Attribute Summary collapse

Attributes included from NextFilter

#last_filter, #next_filter

Instance Method Summary collapse

Methods included from NextFilter

#>>, #exec_next

Constructor Details

#initialize(value) ⇒ RBConvertNilTo



141
142
143
144
# File 'lib/filters.rb', line 141

def initialize(value)
  @value = value
  super()
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



139
140
141
# File 'lib/filters.rb', line 139

def value
  @value
end

Instance Method Details

#execute(value, context) ⇒ Object



146
147
148
149
# File 'lib/filters.rb', line 146

def execute(value, context)
  val = (value)? value : @value
  exec_next(val, context)
end