Class: Obecon::ResponseWrapper
- Inherits:
-
Object
- Object
- Obecon::ResponseWrapper
- Defined in:
- lib/obecon/response_wrapper.rb
Constant Summary collapse
- RESULT =
"result"- ASSET =
"asset"- GALLERY =
SLOTS Fotostrecke Szenenbilder BB*=459x400, jpg, rgb
"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
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response = nil) ⇒ ResponseWrapper
constructor
A new instance of ResponseWrapper.
- #method_missing(method_name, *_args) ⇒ Object
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
#response ⇒ Object (readonly)
Returns the value of attribute response.
53 54 55 |
# File 'lib/obecon/response_wrapper.rb', line 53 def response @response end |