Sha256: ca47508890781ef38819ef25e3456a2f85f8edfc54ffe129089c0aaf82c2081e

Contents?: true

Size: 699 Bytes

Versions: 20

Compression:

Stored size: 699 Bytes

Contents

require 'lib/endeca'
class Listing < Endeca::Document
  path 'http://192.168.3.218:8888/bridge/JSONControllerServlet.do'

  reader \
    :address,
    :contact,
    :description,
    :header,
    :phone

  integer_reader \
    'RecordSpec' => :listing_id

  float_reader \
    :longitude,
    :latitude

  decimal_reader :rent => :price

  boolean_reader :showemail => :show_email?

  reader(:rh_url => :details_url) {|url| "/{url}"}

  add_reader(:caret_delimited_reader) {|string| string.split('^+^')}

  caret_delimited_reader \
    :thumbnails,
    :graphicurl => :graphic_urls

  def coordinates; [latitude, longitude] end
  def image_url; (graphic_urls || thumbnails).first rescue nil end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
primedia-endeca-0.10.0 example/listing.rb
primedia-endeca-0.10.1 example/listing.rb
primedia-endeca-0.11.0 example/listing.rb
primedia-endeca-0.9.10 example/listing.rb
primedia-endeca-0.9.11 example/listing.rb
primedia-endeca-0.9.12 example/listing.rb
primedia-endeca-0.9.13 example/listing.rb
primedia-endeca-0.9.14 example/listing.rb
primedia-endeca-0.9.15 example/listing.rb
primedia-endeca-0.9.16 example/listing.rb
primedia-endeca-0.9.17 example/listing.rb
primedia-endeca-0.9.18 example/listing.rb
primedia-endeca-0.9.19 example/listing.rb
primedia-endeca-0.9.20 example/listing.rb
primedia-endeca-0.9.21 example/listing.rb
primedia-endeca-0.9.22 example/listing.rb
primedia-endeca-0.9.23 example/listing.rb
primedia-endeca-0.9.24 example/listing.rb
primedia-endeca-0.9.25 example/listing.rb
primedia-endeca-0.9.26 example/listing.rb