Sha256: 299ec8aaa84f56387eb215d6b42a6717977bec3e5d910693b9330aa8177ee7d6

Contents?: true

Size: 455 Bytes

Versions: 4

Compression:

Stored size: 455 Bytes

Contents

require "wego/result"

module Wego
  class Search
    def self.create(location_id:, check_in:, check_out:, user_ip:, **options)
      Wego.get_resource(
        "search/new",
        location_id: location_id,
        check_in: Wego.format_date(check_in),
        check_out: Wego.format_date(check_out),
        user_ip: user_ip,
        **options
      )
    end
  end

  def self.format_date(date)
    DateTime.parse(date).strftime("%Y-%m-%d")
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
wego-0.2.2 lib/wego/search.rb
wego-0.2.1 lib/wego/search.rb
wego-0.2.0 lib/wego/search.rb
wego-0.1.5 lib/wego/search.rb