Class: Postal::AddressFormatter::Text
- Inherits:
-
Object
- Object
- Postal::AddressFormatter::Text
- Defined in:
- lib/postal_address/formatters/text.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
Instance Method Summary collapse
-
#initialize(address) ⇒ Text
constructor
expects any hash with the 7 keys from Postal::Address::Fields.
- #render(params = {}) ⇒ Object
Constructor Details
#initialize(address) ⇒ Text
expects any hash with the 7 keys from Postal::Address::Fields
6 7 8 |
# File 'lib/postal_address/formatters/text.rb', line 6 def initialize(address) @address = address end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
4 5 6 |
# File 'lib/postal_address/formatters/text.rb', line 4 def address @address end |
Instance Method Details
#render(params = {}) ⇒ Object
10 11 12 |
# File 'lib/postal_address/formatters/text.rb', line 10 def render(params={}) (address_format % address_data).strip end |