Module: Ishin

Defined in:
lib/ishin.rb,
lib/ishin/mixin.rb,
lib/ishin/version.rb

Overview

Ishin is an object to hash converter Ruby Gem

Defined Under Namespace

Modules: Mixin, Version

Class Method Summary collapse

Class Method Details

.to_hash(object, options = {}) ⇒ Object

Converts objects into their hash representations.

Parameters:

  • object (Object)

    an object to convert

  • options (Hash) (defaults to: {})

    a hash containing conversion options



9
10
11
12
13
14
15
# File 'lib/ishin.rb', line 9

def self.to_hash(object, options = {})
  options = defaults.merge(options)
  result = {}
  type_to_hash(result, object, options)
  evaluate_methods(result, object, options)
  result
end