Module: Poms::Fields
Overview
Gets fields from Poms results
Instance Method Summary collapse
-
#image_id(image) ⇒ Object
Extracts the image id from an image hash Expects a hash of just an image from POMS.
-
#images(item) ⇒ Object
Returns the images from the hash.
-
#title(item, options = { type: 'MAIN' }) ⇒ Object
Returns the title, main by default.
Instance Method Details
#image_id(image) ⇒ Object
Extracts the image id from an image hash Expects a hash of just an image from POMS
18 19 20 |
# File 'lib/poms/fields.rb', line 18 def image_id(image) image['imageUri'].split(':').last end |
#images(item) ⇒ Object
Returns the images from the hash
12 13 14 |
# File 'lib/poms/fields.rb', line 12 def images(item) item['images'] end |
#title(item, options = { type: 'MAIN' }) ⇒ Object
Returns the title, main by default
7 8 9 |
# File 'lib/poms/fields.rb', line 7 def title(item, = { type: 'MAIN' }) item['titles'].find { |title| title['type'] == [:type] }['value'] end |