Class: MiqAeMethodService::MiqAeServiceServiceTemplate

Inherits:
MiqAeServiceModelBase show all
Defined in:
lib/miq_automation_engine/service_models/miq_ae_service_service_template.rb

Constant Summary

Constants inherited from MiqAeServiceModelBase

MiqAeMethodService::MiqAeServiceModelBase::DELIMS, MiqAeMethodService::MiqAeServiceModelBase::EXPOSED_ATTR_BLACK_LIST, MiqAeMethodService::MiqAeServiceModelBase::SERVICE_MODEL_GLOB, MiqAeMethodService::MiqAeServiceModelBase::SERVICE_MODEL_PATH, MiqAeMethodService::MiqAeServiceModelBase::UNWISE

Instance Method Summary collapse

Methods inherited from MiqAeServiceModelBase

ar_base_model, ar_method, #ar_method, association, association=, associations, #associations, base_class, base_model, inherited, #initialize, #inspect, #inspect_all, method_missing, #method_missing, model_name_from_active_record_model, model_name_from_file, #model_suffix, normalize, #object_class, #object_send, #reload, respond_to_missing?, service_models, #tag_assign, #tag_unassign, #taggable?, taggable?, #tagged_with?, #tags, #virtual_column_names, #virtual_columns_inspect, wrap_results, #wrap_results

Methods included from Vmdb::Logging

#_log

Methods included from MiqAeServiceObjectCommon

#[], #[]=, #attributes, #attributes=, #class_name, #current_field_name, #current_field_type, #current_message, #decrypt, #id, #instance_name, #name, #namespace, #parent

Constructor Details

This class inherits a constructor from MiqAeMethodService::MiqAeServiceModelBase

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class MiqAeMethodService::MiqAeServiceModelBase

Instance Method Details

#group=(group) ⇒ Object


19
20
21
22
23
24
25
26
27
28
# File 'lib/miq_automation_engine/service_models/miq_ae_service_service_template.rb', line 19

def group=(group)
  if group.nil? || group.kind_of?(MiqAeMethodService::MiqAeServiceMiqGroup)
    if group.nil?
      @object.miq_group = nil
    else
      @object.miq_group = MiqGroup.find_by_id(group.id)
    end
    @object.save
  end
end

#owner=(owner) ⇒ Object


8
9
10
11
12
13
14
15
16
17
# File 'lib/miq_automation_engine/service_models/miq_ae_service_service_template.rb', line 8

def owner=(owner)
  if owner.nil? || owner.kind_of?(MiqAeMethodService::MiqAeServiceUser)
    if owner.nil?
      @object.evm_owner = nil
    else
      @object.evm_owner = User.find_by_id(owner.id)
    end
    @object.save
  end
end