Class: Mycrm::CoreExt::Address
- Inherits:
-
Object
- Object
- Mycrm::CoreExt::Address
- Defined in:
- lib/mycrm/core_ext/address.rb
Constant Summary collapse
- FIELDS =
[:formatted, :street, :suburb, :state, :postcode, :country]
Instance Method Summary collapse
-
#initialize(formatted, locale = :en_au) ⇒ Address
constructor
A new instance of Address.
- #to_h ⇒ Object
Constructor Details
#initialize(formatted, locale = :en_au) ⇒ Address
Returns a new instance of Address.
10 11 12 13 |
# File 'lib/mycrm/core_ext/address.rb', line 10 def initialize(formatted, locale = :en_au) @formatted = formatted (locale) end |
Instance Method Details
#to_h ⇒ Object
15 16 17 |
# File 'lib/mycrm/core_ext/address.rb', line 15 def to_h FIELDS.reject{ |f| f == :formatted }.each_with_object({}){ |f, out| out[f] = send(f) } end |