Class: DocFox::User::Facade

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Facade

Returns a new instance of Facade.



6
7
8
9
10
11
12
13
14
15
# File 'lib/doc_fox/user/facade.rb', line 6

def initialize(hash)
  @id         = hash.dig('data', 'id') || hash['id']
  @attributes = hash.dig('data', 'attributes') || hash['attributes']

  @deactivated       = attributes['deactivated']
  @deactivation_date = attributes['deactivation_date']
  @email             = attributes['email']
  @first_names       = attributes['first_names']
  @last_names        = attributes['last_names']
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



4
5
6
# File 'lib/doc_fox/user/facade.rb', line 4

def attributes
  @attributes
end

#deactivatedObject (readonly)

Returns the value of attribute deactivated.



4
5
6
# File 'lib/doc_fox/user/facade.rb', line 4

def deactivated
  @deactivated
end

#deactivation_dateObject (readonly)

Returns the value of attribute deactivation_date.



4
5
6
# File 'lib/doc_fox/user/facade.rb', line 4

def deactivation_date
  @deactivation_date
end

#emailObject (readonly)

Returns the value of attribute email.



4
5
6
# File 'lib/doc_fox/user/facade.rb', line 4

def email
  @email
end

#first_namesObject (readonly)

Returns the value of attribute first_names.



4
5
6
# File 'lib/doc_fox/user/facade.rb', line 4

def first_names
  @first_names
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/doc_fox/user/facade.rb', line 4

def id
  @id
end

#last_namesObject (readonly)

Returns the value of attribute last_names.



4
5
6
# File 'lib/doc_fox/user/facade.rb', line 4

def last_names
  @last_names
end