Class: Embedit::Ovi
- Inherits:
-
Object
- Object
- Embedit::Ovi
- Defined in:
- lib/embedit/ovi/ovi.rb
Instance Attribute Summary collapse
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #html(size = {}) ⇒ Object
-
#initialize(url) ⇒ Ovi
constructor
A new instance of Ovi.
Constructor Details
#initialize(url) ⇒ Ovi
10 11 12 13 14 15 16 |
# File 'lib/embedit/ovi/ovi.rb', line 10 def initialize(url) page = Hpricot(open(url)) @url= url work_out_html(page) work_out_format(@html) @title = page.search("h2.pagetitle").inner_html.strip end |
Instance Attribute Details
#format ⇒ Object (readonly)
Returns the value of attribute format.
8 9 10 |
# File 'lib/embedit/ovi/ovi.rb', line 8 def format @format end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
8 9 10 |
# File 'lib/embedit/ovi/ovi.rb', line 8 def title @title end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
8 9 10 |
# File 'lib/embedit/ovi/ovi.rb', line 8 def url @url end |
Instance Method Details
#html(size = {}) ⇒ Object
18 19 20 21 22 |
# File 'lib/embedit/ovi/ovi.rb', line 18 def html(size = {}) @html.gsub!(/height="\d+"/, %{height="#{size[:height]}"}) if size[:height] @html.gsub!(/width="\d+"/, %{width="#{size[:width]}"}) if size[:width] @html end |