Module: Representable::Debug

Defined in:
lib/representable/debug.rb

Defined Under Namespace

Modules: Binding

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

._representable_loggerObject



5
6
7
# File 'lib/representable/debug.rb', line 5

module_function def _representable_logger
  @logger ||= Logger.new(STDOUT)
end

.representable_log(message) ⇒ Object



9
10
11
# File 'lib/representable/debug.rb', line 9

module_function def representable_log(message)
  _representable_logger.debug { message }
end

Instance Method Details

#create_representation_with(doc, options, format) ⇒ Object



19
20
21
22
23
# File 'lib/representable/debug.rb', line 19

def create_representation_with(doc, options, format)
  representable_log "[Serialize]........."
  representable_log "[Serialize]"
  super
end

#representable_mapObject



25
26
27
28
29
# File 'lib/representable/debug.rb', line 25

def representable_map(*)
  super.tap do |arr|
    arr.collect { |bin| bin.extend(Binding) }
  end
end

#update_properties_from(doc, options, format) ⇒ Object



13
14
15
16
17
# File 'lib/representable/debug.rb', line 13

def update_properties_from(doc, options, format)
  representable_log "[Deserialize]........."
  representable_log "[Deserialize] document #{doc.inspect}"
  super
end