Class: Arrayr::Value
- Inherits:
-
Object
- Object
- Arrayr::Value
- Defined in:
- lib/arrayr.rb
Instance Method Summary collapse
-
#initialize(value = nil) ⇒ Value
constructor
A new instance of Value.
- #to_a ⇒ Object
Constructor Details
#initialize(value = nil) ⇒ Value
Returns a new instance of Value.
28 29 30 |
# File 'lib/arrayr.rb', line 28 def initialize(value=nil) @value = value end |
Instance Method Details
#to_a ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/arrayr.rb', line 31 def to_a return nil if @value.nil? if @value.respond_to?(:split) @value.split(',').map(&:strip) else [@value].flatten end end |