Class: Separa
- Inherits:
-
Object
- Object
- Separa
- Defined in:
- lib/separa.rb,
lib/Separa/obj.rb,
lib/Separa/text.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#separador ⇒ Object
readonly
Returns the value of attribute separador.
Instance Method Summary collapse
- #call(words) ⇒ Object
-
#initialize(separador = Separa::Text, opts = {}) ⇒ Separa
constructor
A new instance of Separa.
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
#separador ⇒ Object (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 |