Class: Mdm::Enrollment::AssignProfile

Inherits:
Service::Base show all
Defined in:
lib/mdm/enrollment/service/assign_profile.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Service::Base

accepted_params, #authenticate?, available_services, #params, #params=

Instance Attribute Details

#devicesObject

Returns the value of attribute devices.



7
8
9
# File 'lib/mdm/enrollment/service/assign_profile.rb', line 7

def devices
  @devices
end

#profileObject

Returns the value of attribute profile.



8
9
10
# File 'lib/mdm/enrollment/service/assign_profile.rb', line 8

def profile
  @profile
end

Instance Method Details

#methodObject



20
21
22
# File 'lib/mdm/enrollment/service/assign_profile.rb', line 20

def method
  :put
end

#pathObject



16
17
18
# File 'lib/mdm/enrollment/service/assign_profile.rb', line 16

def path
  '/profile/devices'
end

#resultObject



24
25
26
27
28
29
# File 'lib/mdm/enrollment/service/assign_profile.rb', line 24

def result
  {
    profile_uuid: client.response['profile_uuid'],
    devices: client.response['devices']
  }
end

#startObject



10
11
12
13
14
# File 'lib/mdm/enrollment/service/assign_profile.rb', line 10

def start
  params[:profile_uuid] = profile.profile_uuid
  params[:devices] = devices.map(&:serial_number)
  super
end