Class: Dev::TargetProcess::User

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

Overview

Class containing user information

Constant Summary collapse

RESOURCE_TYPE =

The resource type for the api endpoint

'User'.freeze
PATH =

The api path for user requests

'/User'.freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ User

Returns a new instance of User.



13
14
15
16
17
18
19
20
# File 'lib/firespring_dev_commands/target_process/user.rb', line 13

def initialize(data)
  @data = data
  @id = data['Id']
  @type = data['ResourceType']
  @name = data['FullName']
  @login = data['Login']
  @email = data['Email']
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



11
12
13
# File 'lib/firespring_dev_commands/target_process/user.rb', line 11

def data
  @data
end

#emailObject

Returns the value of attribute email.



11
12
13
# File 'lib/firespring_dev_commands/target_process/user.rb', line 11

def email
  @email
end

#idObject

Returns the value of attribute id.



11
12
13
# File 'lib/firespring_dev_commands/target_process/user.rb', line 11

def id
  @id
end

#loginObject

Returns the value of attribute login.



11
12
13
# File 'lib/firespring_dev_commands/target_process/user.rb', line 11

def 
  @login
end

#nameObject

Returns the value of attribute name.



11
12
13
# File 'lib/firespring_dev_commands/target_process/user.rb', line 11

def name
  @name
end

#typeObject

Returns the value of attribute type.



11
12
13
# File 'lib/firespring_dev_commands/target_process/user.rb', line 11

def type
  @type
end

Class Method Details

.get(id) ⇒ Object

Get the user with the given id and return that object



23
24
25
# File 'lib/firespring_dev_commands/target_process/user.rb', line 23

def self.get(id)
  new(TargetProcess.new.get("#{User::PATH}/#{id}", Query.new))
end