Class: ProteusClient::Representers::Video

Inherits:
Object
  • Object
show all
Defined in:
lib/proteus_client/representers/video.rb

Instance Method Summary collapse

Constructor Details

#initialize(raw_response) ⇒ Video

Returns a new instance of Video.



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/proteus_client/representers/video.rb', line 5

def initialize(raw_response)
  response         = JSON.parse(raw_response)
  versions_hash    = response['_embedded']['proteus:video:versions']
  thumbnails_hash  = response['_embedded']['proteus:video:thumbnails']

  @properties = { 
    id:         response['id'],
    thumbnails: create_thumbnails(thumbnails_hash),
    versions:   create_versions(versions_hash)
  }
end

Instance Method Details

#to_hashObject



17
18
19
# File 'lib/proteus_client/representers/video.rb', line 17

def to_hash
  @properties
end