Class: MiqAeMethodService::MiqAeServiceMiqRequest

Inherits:
MiqAeServiceModelBase show all
Includes:
MiqAeServiceMiqRequestMixin
Defined in:
lib/miq_automation_engine/service_models/miq_ae_service_miq_request.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 included from MiqAeServiceMiqRequestMixin

#add_tag, #clear_tag, #get_classification, #get_classifications, #get_option, #get_option_last, #get_tag, #get_tags, #options, #set_option, #user_message=

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

#approversObject


23
24
25
# File 'lib/miq_automation_engine/service_models/miq_ae_service_miq_request.rb', line 23

def approvers
  ar_method { wrap_results @object.miq_approvals.collect { |a| a.approver.kind_of?(User) ? a.approver : nil }.compact }
end

#description=(new_description) ⇒ Object


32
33
34
# File 'lib/miq_automation_engine/service_models/miq_ae_service_miq_request.rb', line 32

def description=(new_description)
  object_send(:update_attributes, :description => new_description)
end

#miq_requestObject

For backward compatibility


18
19
20
# File 'lib/miq_automation_engine/service_models/miq_ae_service_miq_request.rb', line 18

def miq_request
  self
end

#set_message(value) ⇒ Object


28
29
30
# File 'lib/miq_automation_engine/service_models/miq_ae_service_miq_request.rb', line 28

def set_message(value)
  object_send(:update_attributes, :message => value.try!(:truncate, 255))
end