Method: Restforce::Mash#convert_value

Defined in:
lib/restforce/mash.rb

#convert_value(val, duping = false) ⇒ Object

The #convert_value method and its signature are part of Hashie::Mash’s API, so we can’t unilaterally decide to change ‘duping` to be a keyword argument rubocop:disable Style/OptionalBooleanParameter

[View source]

62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/restforce/mash.rb', line 62

def convert_value(val, duping = false)
  case val
  when self.class
    val.dup
  when ::Hash
    val = val.dup if duping
    self.class.klass(val).new(val, @client)
  when Array
    val.collect { |e| convert_value(e) }
  else
    val
  end
end