Class: Encoder
- Inherits:
-
Object
- Object
- Encoder
- Defined in:
- lib/rbase/encoder.rb
Instance Method Summary collapse
- #en(str) ⇒ Object
-
#initialize(from, to) ⇒ Encoder
constructor
A new instance of Encoder.
Constructor Details
#initialize(from, to) ⇒ Encoder
Returns a new instance of Encoder.
3 4 5 |
# File 'lib/rbase/encoder.rb', line 3 def initialize(from, to) @from, @to = from, to end |
Instance Method Details
#en(str) ⇒ Object
7 8 9 |
# File 'lib/rbase/encoder.rb', line 7 def en(str) str.force_encoding(@from).encode(@to) end |