Class: Screencast
- Inherits:
-
Object
- Object
- Screencast
- Defined in:
- lib/peepcode.rb
Constant Summary collapse
- URL =
URI 'https://peepcode.com/screencasts'
Instance Attribute Summary collapse
-
#image ⇒ Object
readonly
Returns the value of attribute image.
-
#link ⇒ Object
readonly
Returns the value of attribute link.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#image ⇒ Object (readonly)
Returns the value of attribute image.
6 7 8 |
# File 'lib/peepcode.rb', line 6 def image @image end |
#link ⇒ Object (readonly)
Returns the value of attribute link.
6 7 8 |
# File 'lib/peepcode.rb', line 6 def link @link end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
6 7 8 |
# File 'lib/peepcode.rb', line 6 def title @title end |
Class Method Details
.all ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/peepcode.rb', line 8 def self.all i = 0 screencasts = [] count = self.titles.length while i < count sc = Screencast.new( titles[i], image_urls[i], links[i] ) screencasts << sc i += 1 end screencasts.collect(&:to_json) end |
Instance Method Details
#to_json ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/peepcode.rb', line 20 def to_json { title: @title, image: @image, link: @link } end |