Class: Workarea::VideoEmbedParser

Inherits:
Object
  • Object
show all
Defined in:
app/services/workarea/video_embed_parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(embed_code, options = {}) ⇒ VideoEmbedParser

Returns a new instance of VideoEmbedParser.



3
4
5
6
# File 'app/services/workarea/video_embed_parser.rb', line 3

def initialize(embed_code, options = {})
  @parsed_embed_code = Nokogiri::HTML.fragment(embed_code).children.first
  @options = options
end

Instance Method Details

#video_paramsObject



8
9
10
11
12
13
14
15
# File 'app/services/workarea/video_embed_parser.rb', line 8

def video_params
  {
    embed_id: embed_id,
    url: url,
    host: uri.host,
    aspect_ratio: aspect_ratio
  }
end