Class: Monolens::Str::Split

Inherits:
Object
  • Object
show all
Includes:
Lens
Defined in:
lib/monolens/stdlib/str/split.rb

Instance Attribute Summary

Attributes included from Lens

#options

Instance Method Summary collapse

Methods included from Lens

#fail!, included, #initialize

Methods included from Lens::FetchSupport

#fetch_on

Instance Method Details

#call(arg, world = {}) ⇒ Object



10
11
12
13
14
15
# File 'lib/monolens/stdlib/str/split.rb', line 10

def call(arg, world = {})
  is_string!(arg, world)

  sep = option(:separator, ' ')
  sep ? arg.split(sep) : arg.split
end