Class: Bilibili::PageInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/bilibili_console/video.rb

Overview

video page list

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#cidObject

Returns the value of attribute cid.



17
18
19
# File 'lib/bilibili_console/video.rb', line 17

def cid
  @cid
end

#durationObject

Returns the value of attribute duration.



17
18
19
# File 'lib/bilibili_console/video.rb', line 17

def duration
  @duration
end

#fromObject

Returns the value of attribute from.



17
18
19
# File 'lib/bilibili_console/video.rb', line 17

def from
  @from
end

#pageObject

Returns the value of attribute page.



17
18
19
# File 'lib/bilibili_console/video.rb', line 17

def page
  @page
end

#partObject

Returns the value of attribute part.



17
18
19
# File 'lib/bilibili_console/video.rb', line 17

def part
  @part
end

#vidObject

Returns the value of attribute vid.



17
18
19
# File 'lib/bilibili_console/video.rb', line 17

def vid
  @vid
end

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