Class: AgentClient::Process

Inherits:
Object
  • Object
show all
Extended by:
Request
Includes:
Request
Defined in:
lib/agent_client/process.rb

Overview

Represents an Indigo process

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Request

get, post

Constructor Details

#initialize(url, process_name, process_info, store_info) ⇒ Process

Returns a new instance of Process.



24
25
26
27
28
29
# File 'lib/agent_client/process.rb', line 24

def initialize(url, process_name, process_info, store_info)
  self.process_name = process_name
  self.process_url = "#{url}/#{process_name}"
  self.info = process_info
  self.store_info = store_info
end

Instance Attribute Details

#infoObject

Returns the value of attribute info.



22
23
24
# File 'lib/agent_client/process.rb', line 22

def info
  @info
end

#process_nameObject

Returns the value of attribute process_name.



22
23
24
# File 'lib/agent_client/process.rb', line 22

def process_name
  @process_name
end

#process_urlObject

Returns the value of attribute process_url.



22
23
24
# File 'lib/agent_client/process.rb', line 22

def process_url
  @process_url
end

#store_infoObject

Returns the value of attribute store_info.



22
23
24
# File 'lib/agent_client/process.rb', line 22

def store_info
  @store_info
end

Instance Method Details

#create_map(*args) ⇒ Object



31
32
33
34
35
# File 'lib/agent_client/process.rb', line 31

def create_map(*args)
  result = post(process_url + '/segments', json: args)

  Segment.new(self, result)
end

#find_segments(options = {}) ⇒ Object



41
42
43
44
45
46
47
# File 'lib/agent_client/process.rb', line 41

def find_segments(options = {})
  result = get(process_url + '/segments?' + URI.encode_www_form(options))

  result.map do |link|
    Segment.new(self, link)
  end
end

#get_map_ids(options = {}) ⇒ Object



37
38
39
# File 'lib/agent_client/process.rb', line 37

def get_map_ids(options = {})
  get(process_url + '/maps?' + URI.encode_www_form(options))
end

#get_segment(link_hash) ⇒ Object



49
50
51
52
53
# File 'lib/agent_client/process.rb', line 49

def get_segment(link_hash)
  result = get(process_url + '/segments/' + link_hash)

  Segment.new(self, result)
end