Sha256: aa6a8f3a66d7950a71d4435bf2346aa02cedca57cadccfa0791e181b5684887f
Contents?: true
Size: 594 Bytes
Versions: 6
Compression:
Stored size: 594 Bytes
Contents
module A2z module Responses class ImageSet include Helpers attr_accessor :category, :images def initialize @images = {} end def self.from_response(data) new.tap do |image_set| image_set.category = data['Category'] data.each_pair do |key, value| if key =~ /\A(.+)Image\z/ name = underscore($1).to_sym image_set.images[name] = Image.from_response(value) end end image_set.freeze end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems