Sha256: 845cac17c1ffc96ef35bc3656aac3218165b898143b6e875822d565849e47567
Contents?: true
Size: 851 Bytes
Versions: 13
Compression:
Stored size: 851 Bytes
Contents
module ManageIQ module API class Client class ActionResult attr_reader :attributes def initialize(action_hash) raise "Not a valid Action Result specified" unless self.class.an_action_result?(action_hash) @attributes = action_hash.dup end def self.an_action_result?(hash) hash && hash.key?("success") && hash.key?("message") end def succeeded? success end def failed? !success end def method_missing(sym, *args, &block) attributes && attributes.key?(sym.to_s) ? attributes[sym.to_s] : super(sym, *args, &block) end def respond_to_missing?(sym, *args, &block) attributes && attributes.key?(sym.to_s) || super(sym, *args, &block) end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems