Class: Hbci::ElementUnparser
- Inherits:
-
Object
- Object
- Hbci::ElementUnparser
- Defined in:
- lib/hbci/element_unparser.rb
Instance Attribute Summary collapse
-
#element ⇒ Object
readonly
Returns the value of attribute element.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(element, type) ⇒ ElementUnparser
constructor
A new instance of ElementUnparser.
- #unparse ⇒ Object
Constructor Details
#initialize(element, type) ⇒ ElementUnparser
Returns a new instance of ElementUnparser.
8 9 10 11 |
# File 'lib/hbci/element_unparser.rb', line 8 def initialize(element, type) @element = element @type = type end |
Instance Attribute Details
#element ⇒ Object (readonly)
Returns the value of attribute element.
5 6 7 |
# File 'lib/hbci/element_unparser.rb', line 5 def element @element end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/hbci/element_unparser.rb', line 6 def type @type end |
Instance Method Details
#unparse ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/hbci/element_unparser.rb', line 13 def unparse if type == :binary "@#{element.size}@#{element}" else element.to_s.gsub('?', '??').gsub('+', '?+').gsub(':', '?:').gsub('\'', '?\'') end end |