Class: Lipseys::Image
Constant Summary collapse
- API_URL =
'https://www.lipseys.com/API/catalog.ashx'
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Image
constructor
A new instance of Image.
- #urls(options = {}) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Image
Returns a new instance of Image.
6 7 8 9 10 |
# File 'lib/lipseys/image.rb', line 6 def initialize( = {}) requires!(, :username, :password) = end |
Class Method Details
.urls(options = {}) ⇒ Object
12 13 14 |
# File 'lib/lipseys/image.rb', line 12 def self.urls( = {}) new().urls end |
Instance Method Details
#urls(options = {}) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/lipseys/image.rb', line 16 def urls( = {}) tempfile = stream_to_tempfile(API_URL, ) images = Array.new Lipseys::Parser.parse(tempfile, 'Item') do |item| image = Hash.new image[:item_identifier] = content_for(item, 'ItemNo') image[:url] = "http://www.lipseys.net/images/#{content_for(item, 'Image')}" images.push(image) end images end |