Class: PayeeParser
- Inherits:
-
Object
- Object
- PayeeParser
- Defined in:
- lib/ynap/payee_parser.rb
Instance Attribute Summary collapse
-
#regex ⇒ Object
readonly
Returns the value of attribute regex.
Instance Method Summary collapse
- #cleaned_name(label) ⇒ Object
-
#initialize(regex = nil) ⇒ PayeeParser
constructor
A new instance of PayeeParser.
Constructor Details
#initialize(regex = nil) ⇒ PayeeParser
Returns a new instance of PayeeParser.
4 5 6 |
# File 'lib/ynap/payee_parser.rb', line 4 def initialize(regex = nil) @regex = regex || Ynap.regexp end |
Instance Attribute Details
#regex ⇒ Object (readonly)
Returns the value of attribute regex.
2 3 4 |
# File 'lib/ynap/payee_parser.rb', line 2 def regex @regex end |
Instance Method Details
#cleaned_name(label) ⇒ Object
8 9 10 11 |
# File 'lib/ynap/payee_parser.rb', line 8 def cleaned_name(label) matched = label.match(@regex) matched.nil? ? label : matched[:name].strip end |