lib/oso/helpers.rb in oso-cloud-1.6.0 vs lib/oso/helpers.rb in oso-cloud-1.7.1

- old
+ new

@@ -2,11 +2,12 @@ # @!visibility private module Helpers # @!visibility private def self.extract_value(x) return OsoCloud::Core::Value.new(type: 'String', id: x) if x.is_a? String - return OsoCloud::Core::Value.new(type: nil, id: nil) if x.nil? + return OsoCloud::Core::Value.new(type: 'Boolean', id: x.to_s) if [true, false].include? x + return OsoCloud::Core::Value.new(type: 'Integer', id: x.to_s) if x.is_a? Integer type = (x.type.nil? ? nil : x.type.to_s) id = (x.id.nil? ? nil : x.id.to_s) OsoCloud::Core::Value.new(type: type, id: id) end