Class: Obecon::ResponseWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/obecon/response_wrapper.rb

Constant Summary collapse

RESULT =
"result"
ASSET =
"asset"
"fotostrecke"
POSTER =

Filmplakat Filmplakat BB*=400x10000, jpg, rgb

"filmplakat"
TEASER_SMALL =

Filmbild teaser Image klein BB*=180x10000, jpg, rgb

"filmbild"
TEASER_LARGE =

Splash teaser Image gross BB*=456x340, jpg, rgb

"splash"
WEBCONTAINER =

webcontainer Event Content BB*=456x340, jpg, rgb

"webcontainer"
VIDEO_HQ =

*(_hq) Flash-Video 456x340, 480kbit Video, flv

"video_hq"
VIDEO_SMALL_HQ =

*(_small_hq) Flash-Video 180x132, 192kBit Video, flv

"video_small_hq"
VIDEO_SMALL_LQ =

*(_small_lq) Flash-Video 180x132, 64kBit Video, flv

"video_small_lq"
VIDEO_MP4 =

mp4 H264 Video BB*=640x512, 830kBit Video, h264

"video_mp4"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response = nil) ⇒ ResponseWrapper

Returns a new instance of ResponseWrapper.



54
55
56
57
# 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

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *_args) ⇒ Object



59
60
61
62
# 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

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



53
54
55
# File 'lib/obecon/response_wrapper.rb', line 53

def response
  @response
end