Module: Onebox::Mixins::TwitchOnebox::InstanceMethods

Defined in:
lib/onebox/mixins/twitch_onebox.rb

Instance Method Summary collapse

Instance Method Details

#base_urlObject



16
17
18
# File 'lib/onebox/mixins/twitch_onebox.rb', line 16

def base_url
  "player.twitch.tv/?"
end

#to_htmlObject



20
21
22
# File 'lib/onebox/mixins/twitch_onebox.rb', line 20

def to_html
  "<iframe src=\"//#{base_url}#{query_params}&autoplay=false\" width=\"620\" height=\"378\" frameborder=\"0\" style=\"overflow: hidden;\" scrolling=\"no\" allowfullscreen=\"allowfullscreen\"></iframe>"
end

#twitch_idObject



12
13
14
# File 'lib/onebox/mixins/twitch_onebox.rb', line 12

def twitch_id
  @url.match(self.class.twitch_regexp)[1]
end