Class: Bilibili::FavInfo
- Inherits:
-
Object
- Object
- Bilibili::FavInfo
- Defined in:
- lib/bilibili_console/fav.rb
Overview
bilibili fav info
Instance Attribute Summary collapse
-
#attr ⇒ Object
Returns the value of attribute attr.
-
#fav_state ⇒ Object
Returns the value of attribute fav_state.
-
#fid ⇒ Object
Returns the value of attribute fid.
-
#id ⇒ Object
Returns the value of attribute id.
-
#media_count ⇒ Object
Returns the value of attribute media_count.
-
#title ⇒ Object
Returns the value of attribute title.
-
#uid ⇒ Object
Returns the value of attribute uid.
Instance Method Summary collapse
-
#initialize(json) ⇒ FavInfo
constructor
A new instance of FavInfo.
- #to_json(*opt) ⇒ Object
Constructor Details
#initialize(json) ⇒ FavInfo
Returns a new instance of FavInfo.
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/bilibili_console/fav.rb', line 51 def initialize(json) return if json.nil? @id = json[:id] @fid = json[:fid] @uid = json[:mid] @attr = json[:attr] @title = json[:title] @fav_state = json[:fav_state] @media_count = json[:media_count] end |
Instance Attribute Details
#attr ⇒ Object
Returns the value of attribute attr.
49 50 51 |
# File 'lib/bilibili_console/fav.rb', line 49 def attr @attr end |
#fav_state ⇒ Object
Returns the value of attribute fav_state.
49 50 51 |
# File 'lib/bilibili_console/fav.rb', line 49 def fav_state @fav_state end |
#fid ⇒ Object
Returns the value of attribute fid.
49 50 51 |
# File 'lib/bilibili_console/fav.rb', line 49 def fid @fid end |
#id ⇒ Object
Returns the value of attribute id.
49 50 51 |
# File 'lib/bilibili_console/fav.rb', line 49 def id @id end |
#media_count ⇒ Object
Returns the value of attribute media_count.
49 50 51 |
# File 'lib/bilibili_console/fav.rb', line 49 def media_count @media_count end |
#title ⇒ Object
Returns the value of attribute title.
49 50 51 |
# File 'lib/bilibili_console/fav.rb', line 49 def title @title end |
#uid ⇒ Object
Returns the value of attribute uid.
49 50 51 |
# File 'lib/bilibili_console/fav.rb', line 49 def uid @uid end |
Instance Method Details
#to_json(*opt) ⇒ Object
63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/bilibili_console/fav.rb', line 63 def to_json(*opt) { id: @id, fid: @fid, uid: @uid, attr: @attr, title: @title, fav_state: @fav_state, media_count: @media_count }.to_json(*opt) end |