Class: JohnStamos::Pin
- Inherits:
-
Object
- Object
- JohnStamos::Pin
- Defined in:
- lib/john_stamos/pin.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
-
#board ⇒ Object
TODO: Make this a Board object…
- #description ⇒ Object
- #image ⇒ Object
-
#initialize(client, pinterest_pin_id) ⇒ Pin
constructor
A new instance of Pin.
- #like_count ⇒ Object
- #pinner ⇒ Object
- #repin_count ⇒ Object
- #source_url ⇒ Object
- #url ⇒ Object
- #video? ⇒ Boolean
Constructor Details
#initialize(client, pinterest_pin_id) ⇒ Pin
Returns a new instance of Pin.
4 5 6 7 |
# File 'lib/john_stamos/pin.rb', line 4 def initialize(client, pinterest_pin_id) @id = pinterest_pin_id @client = client end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
2 3 4 |
# File 'lib/john_stamos/pin.rb', line 2 def id @id end |
Instance Method Details
#board ⇒ Object
TODO: Make this a Board object… not just a url
22 23 24 |
# File 'lib/john_stamos/pin.rb', line 22 def board ["board"]["url"] end |
#description ⇒ Object
17 18 19 |
# File 'lib/john_stamos/pin.rb', line 17 def description ("description") end |
#image ⇒ Object
9 10 11 |
# File 'lib/john_stamos/pin.rb', line 9 def image ["images"]["orig"]["url"] end |
#like_count ⇒ Object
26 27 28 |
# File 'lib/john_stamos/pin.rb', line 26 def like_count ("like_count") end |
#pinner ⇒ Object
38 39 40 |
# File 'lib/john_stamos/pin.rb', line 38 def pinner JohnStamos::Pinner.new(@client, ["pinner"]["username"]) end |
#repin_count ⇒ Object
30 31 32 |
# File 'lib/john_stamos/pin.rb', line 30 def repin_count ("repin_count") end |
#source_url ⇒ Object
34 35 36 |
# File 'lib/john_stamos/pin.rb', line 34 def source_url ("link") end |
#url ⇒ Object
42 43 44 |
# File 'lib/john_stamos/pin.rb', line 42 def url "http://pinterest.com/pin/#{@id}/" end |
#video? ⇒ Boolean
13 14 15 |
# File 'lib/john_stamos/pin.rb', line 13 def video? ("is_video") end |