Class: EasyshipRatesRubyApi::Mash

Inherits:
Hashie::Mash
  • Object
show all
Defined in:
lib/easyship/rates/ruby/api/mash.rb

Overview

The generalized pseudo-object that is returned for all query requests.

Class Method Summary collapse

Class Method Details

.from_json(json_string) ⇒ Easyship::Rates::Ruby::Mash

Convert a json string to a Mash

Parameters:

  • json_string (String)

Returns:

  • (Easyship::Rates::Ruby::Mash)


12
13
14
15
# File 'lib/easyship/rates/ruby/api/mash.rb', line 12

def self.from_json(json_string)
  result_hash = ::MultiJson.decode(json_string)
  new(result_hash)
end

.override_loggingObject



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/easyship/rates/ruby/api/mash.rb', line 17

def self.override_logging
  require 'hashie/version'
  return unless Gem::Version.new(Hashie::VERSION) >= Gem::Version.new('3.5.0')

  if respond_to?(:disable_warnings)
    disable_warnings
  else
    define_method(:log_built_in_message) { |*| }
    private :log_built_in_message
  end
end