Class: Nicovideo::Random

Inherits:
Page
  • Object
show all
Includes:
Enumerable
Defined in:
lib/nicovideo/random.rb

Constant Summary

Constants inherited from Page

Page::BASE_TITLE1, Page::BASE_TITLE2, Page::BASE_URL, Page::NV_DEBUG_LEVEL

Instance Method Summary collapse

Methods inherited from Page

#exists?, #html, #title=

Constructor Details

#initialize(agent) ⇒ Random

Returns a new instance of Random.



5
6
7
8
9
# File 'lib/nicovideo/random.rb', line 5

def initialize agent
  super(agent)
  @url = url()
  self.register_getter ["videos"]
end

Instance Method Details

#eachObject



11
12
13
# File 'lib/nicovideo/random.rb', line 11

def each
  self.videos.each {|v| yield v }
end

#reloadObject



23
24
# File 'lib/nicovideo/random.rb', line 23

def reload
end

#to_aObject



19
20
21
# File 'lib/nicovideo/random.rb', line 19

def to_a
  videos()
end

#urlObject



15
16
17
# File 'lib/nicovideo/random.rb', line 15

def url
  "#{BASE_URL}/random"
end