Sha256: b6ec534844000386b5351df524a7ec5bc926e698554af0631be638080b16283a

Contents?: true

Size: 344 Bytes

Versions: 3

Compression:

Stored size: 344 Bytes

Contents

# shortcut for JsonExporter.define(:page) {}
# JsonExporter :page do
#   prop :name
# end

# shortcut for JsonExporter.new(Page.first).render
# JsonExporter Page.first

def JsonExporter name_or_object, opts = {}, &block
  if block
    JsonExporter.define name_or_object, &block
  else
    JsonExporter.new(name_or_object, opts).render
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
json-exporter-0.4.4 ./lib/json-exporter/klass_func.rb
json-exporter-0.4.3 ./lib/json-exporter/klass_func.rb
json-exporter-0.4.1 ./lib/json-exporter/klass_func.rb