Class: Fountain::User

Inherits:
Object
  • Object
show all
Defined in:
lib/fountain/user.rb

Overview

Fountain User

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ User

Returns a new instance of User.

Parameters:

  • data (Hash)

    Raw user data



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_dataObject (readonly)

Raw user data



9
10
11
# File 'lib/fountain/user.rb', line 9

def raw_data
  @raw_data
end

Instance Method Details

#emailObject

Email



29
30
31
# File 'lib/fountain/user.rb', line 29

def email
  raw_data['email']
end

#idObject

User ID



19
20
21
# File 'lib/fountain/user.rb', line 19

def id
  raw_data['id']
end

#inspectObject



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

#nameObject

Name



24
25
26
# File 'lib/fountain/user.rb', line 24

def name
  raw_data['name']
end