Sha256: f65c6f1f517469e3fd0399b5d27df2edea8818610ad446864811cc536b385976
Contents?: true
Size: 797 Bytes
Versions: 13
Compression:
Stored size: 797 Bytes
Contents
module ActionMixin extend ActiveSupport::Concern private def clear_actions @actions = [] end def actions_present? @actions.present? end def fetch_actions(resource_hash) @actions = Array(resource_hash["actions"]).collect { |action| ManageIQ::API::Client::Action.new(action) } end def find_action(action) action_str = action.to_s @actions.detect { |a| a.name == action_str } if @actions end def action_defined?(action) find_action(action) end def actions=(action_array) @actions = action_array.blank? ? [] : action_array end def add_action(action) @actions << action end def action_result(hash) ManageIQ::API::Client::ActionResult.an_action_result?(hash) ? ManageIQ::API::Client::ActionResult.new(hash) : hash end end
Version data entries
13 entries across 13 versions & 1 rubygems