Class: Bilibili::PageInfo
- Inherits:
-
Object
- Object
- Bilibili::PageInfo
- Defined in:
- lib/bilibili_console/video.rb
Overview
video page list
Instance Attribute Summary collapse
-
#cid ⇒ Object
Returns the value of attribute cid.
-
#duration ⇒ Object
Returns the value of attribute duration.
-
#from ⇒ Object
Returns the value of attribute from.
-
#page ⇒ Object
Returns the value of attribute page.
-
#part ⇒ Object
Returns the value of attribute part.
-
#vid ⇒ Object
Returns the value of attribute vid.
-
#weblink ⇒ Object
Returns the value of attribute weblink.
Instance Method Summary collapse
-
#initialize(json) ⇒ PageInfo
constructor
A new instance of PageInfo.
- #to_json(*opt) ⇒ Object
Constructor Details
#initialize(json) ⇒ PageInfo
Returns a new instance of PageInfo.
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/bilibili_console/video.rb', line 19 def initialize(json) return if json.nil? @cid = json[:cid] @page = json[:page] @from = json[:from] @part = json[:part] @duration = json[:duration] @vid = json[:vid] @weblink = json[:weblink] end |
Instance Attribute Details
#cid ⇒ Object
Returns the value of attribute cid.
17 18 19 |
# File 'lib/bilibili_console/video.rb', line 17 def cid @cid end |
#duration ⇒ Object
Returns the value of attribute duration.
17 18 19 |
# File 'lib/bilibili_console/video.rb', line 17 def duration @duration end |
#from ⇒ Object
Returns the value of attribute from.
17 18 19 |
# File 'lib/bilibili_console/video.rb', line 17 def from @from end |
#page ⇒ Object
Returns the value of attribute page.
17 18 19 |
# File 'lib/bilibili_console/video.rb', line 17 def page @page end |
#part ⇒ Object
Returns the value of attribute part.
17 18 19 |
# File 'lib/bilibili_console/video.rb', line 17 def part @part end |
#vid ⇒ Object
Returns the value of attribute vid.
17 18 19 |
# File 'lib/bilibili_console/video.rb', line 17 def vid @vid end |
#weblink ⇒ Object
Returns the value of attribute weblink.
17 18 19 |
# File 'lib/bilibili_console/video.rb', line 17 def weblink @weblink end |
Instance Method Details
#to_json(*opt) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/bilibili_console/video.rb', line 31 def to_json(*opt) { cid: @cid, page: @page, from: @from, part: @part, duration: @duration, vid: @vid, weblink: @weblink }.to_json(*opt) end |