Module: Scrobbler::ImageClassFuncs
Overview
Defines some functions that are used nearly all Scrobbler classes which have to deal with image references.
This module defines the class functions, use “extend ImageClassFuncs” in class.
Instance Method Summary collapse
-
#maybe_image_node(data, node) ⇒ Object
Check if the given libxml node is an image referencing node and in case of, read it into that given hash of data.
Instance Method Details
#maybe_image_node(data, node) ⇒ Object
Check if the given libxml node is an image referencing node and in case of, read it into that given hash of data
10 11 12 13 14 15 16 17 |
# File 'lib/scrobbler/helper/image.rb', line 10 def maybe_image_node(data, node) if node.name == 'image' data[:image_small] = node.content if node['size'] == 'small' data[:image_medium] = node.content if node['size'] == 'medium' data[:image_large] = node.content if node['size'] == 'large' data[:image_extralarge] = node.content if node['size'] == 'extralarge' end end |