Class: ActiveModelArchive::Archiver::Json

Inherits:
Object
  • Object
show all
Defined in:
lib/active_model_archive/archiver/json.rb

Instance Method Summary collapse

Instance Method Details

#encode(object) ⇒ Object



7
8
9
# File 'lib/active_model_archive/archiver/json.rb', line 7

def encode(object)
  (@encoder ||= Yajl::Encoder.new).encode(object.as_archive) + "\n"
end

#header(object) ⇒ Object



4
5
# File 'lib/active_model_archive/archiver/json.rb', line 4

def header(object)
end

#parse(io, &block) ⇒ Object



11
12
13
# File 'lib/active_model_archive/archiver/json.rb', line 11

def parse(io, &block)
  (@parser ||= Yajl::Parser.new).parse(io, &block)
end