Class: Twoffein::Profile
- Inherits:
-
Struct
- Object
- Struct
- Twoffein::Profile
- Defined in:
- lib/twoffein-client/profile.rb,
lib/twoffein-client/profile.rb
Instance Attribute Summary collapse
-
#bluttwoffeinkonzentration ⇒ Object
Returns the value of attribute bluttwoffeinkonzentration.
-
#drink ⇒ Object
Returns the value of attribute drink.
-
#drunken ⇒ Object
Returns the value of attribute drunken.
-
#first_login ⇒ Object
Returns the value of attribute first_login.
-
#quest ⇒ Object
Returns the value of attribute quest.
-
#rank ⇒ Object
Returns the value of attribute rank.
-
#rank_title ⇒ Object
Returns the value of attribute rank_title.
-
#screen_name ⇒ Object
Returns the value of attribute screen_name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hash = nil) ⇒ Profile
constructor
A new instance of Profile.
- #to_s ⇒ Object
Constructor Details
#initialize(hash = nil) ⇒ Profile
Returns a new instance of Profile.
18 19 20 21 |
# File 'lib/twoffein-client/profile.rb', line 18 def initialize(hash=nil) return super(*hash) if hash.nil? hash.each { |key,val| self[key] = val if members.include? key } end |
Instance Attribute Details
#bluttwoffeinkonzentration ⇒ Object
Returns the value of attribute bluttwoffeinkonzentration
8 9 10 |
# File 'lib/twoffein-client/profile.rb', line 8 def bluttwoffeinkonzentration @bluttwoffeinkonzentration end |
#drink ⇒ Object
Returns the value of attribute drink
8 9 10 |
# File 'lib/twoffein-client/profile.rb', line 8 def drink @drink end |
#drunken ⇒ Object
Returns the value of attribute drunken
8 9 10 |
# File 'lib/twoffein-client/profile.rb', line 8 def drunken @drunken end |
#first_login ⇒ Object
Returns the value of attribute first_login
8 9 10 |
# File 'lib/twoffein-client/profile.rb', line 8 def first_login @first_login end |
#quest ⇒ Object
Returns the value of attribute quest
8 9 10 |
# File 'lib/twoffein-client/profile.rb', line 8 def quest @quest end |
#rank ⇒ Object
Returns the value of attribute rank
8 9 10 |
# File 'lib/twoffein-client/profile.rb', line 8 def rank @rank end |
#rank_title ⇒ Object
Returns the value of attribute rank_title
8 9 10 |
# File 'lib/twoffein-client/profile.rb', line 8 def rank_title @rank_title end |
#screen_name ⇒ Object
Returns the value of attribute screen_name
8 9 10 |
# File 'lib/twoffein-client/profile.rb', line 8 def screen_name @screen_name end |
Class Method Details
Instance Method Details
#to_s ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/twoffein-client/profile.rb', line 27 def to_s hash = instance_hash max_length = hash.keys.map { |k| k.length }.max hash.map { |attr, value| attr = attr.to_sym if attr == :first_login value = human_readable_time(value) end postfix = ":" attr = human_readable_key(attr) + postfix "#{attr.to_s.ljust(max_length+postfix.length+1)}#{value}" }.join("\n") end |