Class: Bilibili::UserInfo
- Inherits:
-
Object
- Object
- Bilibili::UserInfo
- Defined in:
- lib/bilibili_console/login.rb
Overview
bilibili user info
Instance Attribute Summary collapse
-
#face ⇒ Object
Returns the value of attribute face.
-
#level_info ⇒ Object
Returns the value of attribute level_info.
-
#money ⇒ Object
Returns the value of attribute money.
-
#moral ⇒ Object
Returns the value of attribute moral.
-
#uid ⇒ Object
Returns the value of attribute uid.
-
#uname ⇒ Object
Returns the value of attribute uname.
-
#vip_type ⇒ Object
Returns the value of attribute vip_type.
Instance Method Summary collapse
-
#initialize(json) ⇒ UserInfo
constructor
A new instance of UserInfo.
- #to_json(*opt) ⇒ Object
Constructor Details
#initialize(json) ⇒ UserInfo
Returns a new instance of UserInfo.
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/bilibili_console/login.rb', line 21 def initialize(json) return if json.nil? @face = json[:face] @level_info = json[:level_info] @uid = json[:mid] @money = json[:money] @moral = json[:moral] @uname = json[:moral] @vip_type = json[:vipType] end |
Instance Attribute Details
#face ⇒ Object
Returns the value of attribute face.
19 20 21 |
# File 'lib/bilibili_console/login.rb', line 19 def face @face end |
#level_info ⇒ Object
Returns the value of attribute level_info.
19 20 21 |
# File 'lib/bilibili_console/login.rb', line 19 def level_info @level_info end |
#money ⇒ Object
Returns the value of attribute money.
19 20 21 |
# File 'lib/bilibili_console/login.rb', line 19 def money @money end |
#moral ⇒ Object
Returns the value of attribute moral.
19 20 21 |
# File 'lib/bilibili_console/login.rb', line 19 def moral @moral end |
#uid ⇒ Object
Returns the value of attribute uid.
19 20 21 |
# File 'lib/bilibili_console/login.rb', line 19 def uid @uid end |
#uname ⇒ Object
Returns the value of attribute uname.
19 20 21 |
# File 'lib/bilibili_console/login.rb', line 19 def uname @uname end |
#vip_type ⇒ Object
Returns the value of attribute vip_type.
19 20 21 |
# File 'lib/bilibili_console/login.rb', line 19 def vip_type @vip_type end |
Instance Method Details
#to_json(*opt) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/bilibili_console/login.rb', line 33 def to_json(*opt) { face: @face, level_info: @level_info, uid: @uid, money: @money, moral: @moral, uname: @uname, vip_type: @vip_type }.to_json(*opt) end |