Class: Drone::User

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(remote: nil, login: nil, name: nil, email: nil, gravatar: nil, admin: nil, active: nil, created_at: nil, updated_at: nil, synced_at: nil) ⇒ User

Returns a new instance of User.



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/drone/user.rb', line 5

def initialize(
    remote: nil, login: nil, name: nil, email: nil, gravatar: nil, admin: nil, active: nil, created_at: nil, updated_at: nil, synced_at: nil)
  @remote     = remote
  @login      = 
  @name       = name
  @email      = email
  @gravatar   = gravatar
  @admin      = admin
  @active     = active
  @created_at = created_at
  @updated_at = updated_at
  @synced_at  = synced_at
end

Instance Attribute Details

#activeObject (readonly)

Returns the value of attribute active.



3
4
5
# File 'lib/drone/user.rb', line 3

def active
  @active
end

#adminObject (readonly)

Returns the value of attribute admin.



3
4
5
# File 'lib/drone/user.rb', line 3

def admin
  @admin
end

#created_atObject (readonly)

Returns the value of attribute created_at.



3
4
5
# File 'lib/drone/user.rb', line 3

def created_at
  @created_at
end

#emailObject (readonly)

Returns the value of attribute email.



3
4
5
# File 'lib/drone/user.rb', line 3

def email
  @email
end

#gravatarObject (readonly)

Returns the value of attribute gravatar.



3
4
5
# File 'lib/drone/user.rb', line 3

def gravatar
  @gravatar
end

#loginObject (readonly)

Returns the value of attribute login.



3
4
5
# File 'lib/drone/user.rb', line 3

def 
  @login
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/drone/user.rb', line 3

def name
  @name
end

#remoteObject (readonly)

Returns the value of attribute remote.



3
4
5
# File 'lib/drone/user.rb', line 3

def remote
  @remote
end

#synced_atObject (readonly)

Returns the value of attribute synced_at.



3
4
5
# File 'lib/drone/user.rb', line 3

def synced_at
  @synced_at
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



3
4
5
# File 'lib/drone/user.rb', line 3

def updated_at
  @updated_at
end

Class Method Details

.build_with_hash(hash) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/drone/user.rb', line 19

def self.build_with_hash(hash)
  User.new(
    remote:     hash["remote"],
    login:      hash["login"],
    name:       hash["name"],
    email:      hash["email"],
    gravatar:   hash["gravatar"],
    admin:      hash["admin"],
    active:     hash["active"],
    created_at: hash["created_at"],
    updated_at: hash["updated_at"],
    synced_at:  hash["synced_at"]
  )
end