Module: Extractula::OEmbed

Included in:
Flickr, Vimeo, YouTube
Defined in:
lib/extractula/oembed.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods Classes: Response

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



7
8
9
10
11
12
# File 'lib/extractula/oembed.rb', line 7

def self.included(base)
  base.class_eval {
    extend  Extractula::OEmbed::ClassMethods
    include Extractula::OEmbed::InstanceMethods
  }
end

.max_height(height = nil) ⇒ Object



28
29
30
31
# File 'lib/extractula/oembed.rb', line 28

def self.max_height(height = nil)
  @global_oembed_max_height = height if height
  @global_oembed_max_height
end

.max_width(width = nil) ⇒ Object



23
24
25
26
# File 'lib/extractula/oembed.rb', line 23

def self.max_width(width = nil)
  @global_oembed_max_width = width if width
  @global_oembed_max_width
end

.request(request) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/extractula/oembed.rb', line 14

def self.request(request)
  http_response = Typhoeus::Request.get(request)
  if http_response.code == 200
    Extractula::OEmbed::Response.new(http_response.body)
  else
    # do something
  end
end