Class: Refinery::LocationExplorer::Location
- Inherits:
-
Core::BaseModel
- Object
- Core::BaseModel
- Refinery::LocationExplorer::Location
- Defined in:
- app/models/refinery/location_explorer/location.rb
Instance Method Summary collapse
- #colour ⇒ Object
- #description_preview ⇒ Object
- #detail_url ⇒ Object
- #latlng ⇒ Object
- #preview_image_url ⇒ Object
Instance Method Details
#colour ⇒ Object
32 33 34 |
# File 'app/models/refinery/location_explorer/location.rb', line 32 def colour colour_override end |
#description_preview ⇒ Object
15 16 17 18 19 20 21 |
# File 'app/models/refinery/location_explorer/location.rb', line 15 def description_preview if description matches = description.match(/<p>(.*)<\/p>/) text = matches ? matches[1] : description text.truncate(200) end end |
#detail_url ⇒ Object
36 37 38 |
# File 'app/models/refinery/location_explorer/location.rb', line 36 def detail_url "/location_explorer/#{to_param}" end |
#latlng ⇒ Object
23 24 25 |
# File 'app/models/refinery/location_explorer/location.rb', line 23 def latlng [latitude, longitude] if latitude && longitude end |
#preview_image_url ⇒ Object
27 28 29 30 |
# File 'app/models/refinery/location_explorer/location.rb', line 27 def preview_image_url image = images.first image.thumbnail("253x160#c").url if image end |