Class: Embedit::Myspace
- Inherits:
-
Object
- Object
- Embedit::Myspace
- Defined in:
- lib/embedit/providers/myspace.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.
Class Method Summary collapse
Instance Method Summary collapse
- #html(size = {}) ⇒ Object
-
#initialize(url) ⇒ Myspace
constructor
A new instance of Myspace.
Constructor Details
#initialize(url) ⇒ Myspace
Returns a new instance of Myspace.
7 8 9 10 |
# File 'lib/embedit/providers/myspace.rb', line 7 def initialize(url) @url = url @format = 'picture' end |
Instance Attribute Details
#format ⇒ Object (readonly)
Returns the value of attribute format.
5 6 7 |
# File 'lib/embedit/providers/myspace.rb', line 5 def format @format end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
5 6 7 |
# File 'lib/embedit/providers/myspace.rb', line 5 def title @title end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
5 6 7 |
# File 'lib/embedit/providers/myspace.rb', line 5 def url @url end |
Class Method Details
.match(url) ⇒ Object
24 25 26 |
# File 'lib/embedit/providers/myspace.rb', line 24 def self.match(url) url.match(/viewmorepics\.myspace\.com/) end |
Instance Method Details
#html(size = {}) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/embedit/providers/myspace.rb', line 16 def html(size = {}) attributes = size.collect {|k,v| "#{k}=\"#{v}\" "}.join(" ") puts src = page.at("img#userImage").to_s.slice(/src=.+\.\w+/) %{ <a href="#{@url}"><img src="#{src}" #{attributes}/></a> } end |