Class: Separa

Inherits:
Object
  • Object
show all
Defined in:
lib/separa.rb,
lib/Separa/obj.rb,
lib/Separa/text.rb

Defined Under Namespace

Modules: Obj, Text

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(separador = Separa::Text, opts = {}) ⇒ Separa

Returns a new instance of Separa.



7
8
9
10
11
12
13
14
15
# File 'lib/separa.rb', line 7

def initialize(separador = Separa::Text, opts = {})
    if separador.respond_to?(:call)
        @separador = separador
        @opts = opts
    else
        @separador = Separa::Text
        @opts = separador
    end
end

Instance Attribute Details

#separadorObject (readonly)

Returns the value of attribute separador.



5
6
7
# File 'lib/separa.rb', line 5

def separador
  @separador
end

Instance Method Details

#call(words) ⇒ Object



17
18
19
# File 'lib/separa.rb', line 17

def call(words)
    @separador.call(words, @opts)
end