class Obecon::ResponseWrapper
Constants
- ASSET
- GALLERY
SLOTS Fotostrecke Szenenbilder BB*=459x400, jpg, rgb
- POSTER
Filmplakat Filmplakat BB*=400x10000, jpg, rgb
- RESULT
- TEASER_LARGE
Splash teaser Image gross BB*=456x340, jpg, rgb
- TEASER_SMALL
Filmbild teaser Image klein BB*=180x10000, jpg, rgb
- VIDEO_HQ
*(_hq) Flash-Video 456x340, 480kbit Video, flv
- VIDEO_MP4
mp4 H264 Video BB*=640x512, 830kBit Video, h264
- VIDEO_SMALL_HQ
*(_small_hq) Flash-Video 180x132, 192kBit Video, flv
- VIDEO_SMALL_LQ
*(_small_lq) Flash-Video 180x132, 64kBit Video, flv
- WEBCONTAINER
webcontainer Event Content BB*=456x340, jpg, rgb
Attributes
response[R]
Public Class Methods
new(response = nil)
click to toggle source
# File lib/obecon/response_wrapper.rb, line 54 def initialize(response = nil) assets = JSON.parse(response)[RESULT][ASSET] @slot_map = map_by_slots(assets) end
Public Instance Methods
method_missing(method_name, *_args)
click to toggle source
# File lib/obecon/response_wrapper.rb, line 59 def method_missing(method_name, *_args) mapped_slot = ResponseWrapper.const_get method_name.upcase @slot_map[mapped_slot.to_sym] end
Private Instance Methods
map_by_slots(array)
click to toggle source
# File lib/obecon/response_wrapper.rb, line 66 def map_by_slots(array) result = {} array.each do |entry| key = entry["slot"].to_sym result[key] = [] unless result.key?(key) result[key] << Obecon::Asset.new(entry) end result end