Class: Fountain::User
- Inherits:
-
Object
- Object
- Fountain::User
- Defined in:
- lib/fountain/user.rb
Overview
Fountain User
Instance Attribute Summary collapse
-
#raw_data ⇒ Object
readonly
Raw user data.
Instance Method Summary collapse
-
#email ⇒ Object
Email.
-
#id ⇒ Object
User ID.
-
#initialize(data) ⇒ User
constructor
A new instance of User.
- #inspect ⇒ Object
-
#name ⇒ Object
Name.
Constructor Details
#initialize(data) ⇒ User
Returns a new instance of User.
14 15 16 |
# File 'lib/fountain/user.rb', line 14 def initialize(data) @raw_data = Util.stringify_hash_keys data end |
Instance Attribute Details
#raw_data ⇒ Object (readonly)
Raw user data
9 10 11 |
# File 'lib/fountain/user.rb', line 9 def raw_data @raw_data end |
Instance Method Details
#email ⇒ Object
29 30 31 |
# File 'lib/fountain/user.rb', line 29 def email raw_data['email'] end |
#id ⇒ Object
User ID
19 20 21 |
# File 'lib/fountain/user.rb', line 19 def id raw_data['id'] end |
#inspect ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/fountain/user.rb', line 33 def inspect format( '#<%<class_name>s:0x%<object_id>p @id="%<id>s" @name="%<name>s">', class_name: self.class.name, object_id: object_id, id: id, name: name ) end |
#name ⇒ Object
Name
24 25 26 |
# File 'lib/fountain/user.rb', line 24 def name raw_data['name'] end |