Class: Dotloop::LoopDetail
- Inherits:
-
Object
- Object
- Dotloop::LoopDetail
- Defined in:
- lib/dotloop/loop_detail.rb
Constant Summary collapse
- FIXED_SECTIONS =
%i[ contract_dates contract_info financials geographic_description listing_information offer_dates property_address property referral ].freeze
Instance Attribute Summary collapse
-
#details ⇒ Object
Returns the value of attribute details.
Instance Method Summary collapse
-
#initialize(data) ⇒ LoopDetail
constructor
A new instance of LoopDetail.
- #parse_data(data) ⇒ Object
Constructor Details
#initialize(data) ⇒ LoopDetail
Returns a new instance of LoopDetail.
11 12 13 14 |
# File 'lib/dotloop/loop_detail.rb', line 11 def initialize(data) @details = FIXED_SECTIONS.each_with_object({}) { |key, memo| memo[key] = {} }.merge(contacts: []) parse_data(data) end |
Instance Attribute Details
#details ⇒ Object
Returns the value of attribute details.
5 6 7 |
# File 'lib/dotloop/loop_detail.rb', line 5 def details @details end |
Instance Method Details
#parse_data(data) ⇒ Object
16 17 18 |
# File 'lib/dotloop/loop_detail.rb', line 16 def parse_data(data) fix_hash_keys(data).each { |item| build_section(item[0], item[1]) } end |