Class: UU::OS::Macro::MacroExec

Inherits:
REST::DTO show all
Defined in:
uu_os-0.29.16/lib/uu/os/macro/macro_exec.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from REST::DTO

#initialize, #to_json

Constructor Details

This class inherits a constructor from UU::OS::REST::DTO

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class UU::OS::REST::DTO

Instance Attribute Details

- (Object) data

Macro data (parameters). The expected value is an instance of Hash, JSON representing Hash or UESURI of text property containing JSON representing Hash.



21
22
23
# File 'uu_os-0.29.16/lib/uu/os/macro/macro_exec.rb', line 21

def data
  @data
end

- (Object) options

Additional macro options (may be an instance of Hash, JSON representing Hash or UESURI of text property containing JSON representing Hash).



25
26
27
# File 'uu_os-0.29.16/lib/uu/os/macro/macro_exec.rb', line 25

def options
  @options
end

- (Object) use_case_code

Code of use case be execute (use case code is translated to a particular macro based on main entity using use case registry).



12
13
14
# File 'uu_os-0.29.16/lib/uu/os/macro/macro_exec.rb', line 12

def use_case_code
  @use_case_code
end

- (Object) wait_for_finish

Flag determining if the invoker wants the command to automatically wait for macro completion (including all subtasks) or will handle the waiting itself (using the returned UESURI of macro process). Default value: do not wait automatically.



17
18
19
# File 'uu_os-0.29.16/lib/uu/os/macro/macro_exec.rb', line 17

def wait_for_finish
  @wait_for_finish
end

Instance Method Details

- (Object) to_hash



59
60
61
62
63
64
65
66
67
68
69
70
# File 'uu_os-0.29.16/lib/uu/os/macro/macro_exec.rb', line 59

def to_hash 
  hash = super()
  # We have to send data and options as JSON.
  # (Server cannot parse Object representing Map)
  if hash[:data].kind_of?Hash
    hash[:data] = hash[:data].to_json
  end
  if hash[:options].kind_of?Hash
    hash[:options] = hash[:options].to_json
  end
  hash
end