Class: Monolens::Str::Split
- Inherits:
-
Object
- Object
- Monolens::Str::Split
- Includes:
- Lens
- Defined in:
- lib/monolens/str/split.rb
Instance Attribute Summary
Attributes included from Lens
Instance Method Summary collapse
Methods included from Lens
#fetch_on, #initialize, #is_array!, #is_enumerable!, #is_hash!, #is_string!, #option
Instance Method Details
#call(arg, *rest) ⇒ Object
6 7 8 9 10 11 |
# File 'lib/monolens/str/split.rb', line 6 def call(arg, *rest) is_string!(arg) sep = option(:separator) sep ? arg.split(sep) : arg.split end |