Class: EhbrsRubyUtils::Airbnb::Processors::Page

Inherits:
EhbrsRubyUtils::Aranha::AccommodationsProcessor show all
Defined in:
lib/ehbrs_ruby_utils/airbnb/processors/page.rb,
lib/ehbrs_ruby_utils/airbnb/processors/page/build_accommodation.rb

Defined Under Namespace

Classes: BuildAccommodation

Constant Summary

Constants inherited from EhbrsRubyUtils::Aranha::AccommodationsProcessor

EhbrsRubyUtils::Aranha::AccommodationsProcessor::SCROLL_DOWN_STEP

Instance Method Summary collapse

Methods inherited from EhbrsRubyUtils::Aranha::AccommodationsProcessor

#accommodations, #declared_count

Instance Method Details

#all_data_loaded?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/ehbrs_ruby_utils/airbnb/processors/page.rb', line 10

def all_data_loaded?
  parser.data.fetch(:accommodations).all? { |e| e.fetch(:name).present? }
end

#next_page_urlAddressable::URI

Returns:

  • (Addressable::URI)


15
16
17
18
19
# File 'lib/ehbrs_ruby_utils/airbnb/processors/page.rb', line 15

def next_page_url
  data.fetch(:next_page_href).if_present do |v|
    url + v
  end
end