Class: Bilibili::FavMediaInfo

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

Overview

fav media info

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ FavMediaInfo

Returns a new instance of FavMediaInfo.



109
110
111
112
113
114
115
116
117
118
# File 'lib/bilibili_console/fav.rb', line 109

def initialize(json)
  return if json.nil?

  @id = json[:id]
  @type = json[:type]
  @title = json[:title]
  @intro = json[:intro]
  @page = json[:page]
  @bv_id = json[:bv_id]
end

Instance Attribute Details

#bv_idObject

Returns the value of attribute bv_id.



107
108
109
# File 'lib/bilibili_console/fav.rb', line 107

def bv_id
  @bv_id
end

#idObject

Returns the value of attribute id.



107
108
109
# File 'lib/bilibili_console/fav.rb', line 107

def id
  @id
end

#introObject

Returns the value of attribute intro.



107
108
109
# File 'lib/bilibili_console/fav.rb', line 107

def intro
  @intro
end

#pageObject

Returns the value of attribute page.



107
108
109
# File 'lib/bilibili_console/fav.rb', line 107

def page
  @page
end

#titleObject

Returns the value of attribute title.



107
108
109
# File 'lib/bilibili_console/fav.rb', line 107

def title
  @title
end

#typeObject

Returns the value of attribute type.



107
108
109
# File 'lib/bilibili_console/fav.rb', line 107

def type
  @type
end

Instance Method Details

#to_json(*opt) ⇒ Object



120
121
122
123
124
125
126
127
128
129
# File 'lib/bilibili_console/fav.rb', line 120

def to_json(*opt)
  {
    id: @id,
    type: @type,
    title: @title,
    intro: @intro,
    page: @page,
    bv_id: @bv_id
  }.to_json(*opt)
end