Sha256: 576f6bc433ff585e2c5ee01289fb4e1b5347081053678b1d6ab22571cdd48827
Contents?: true
Size: 554 Bytes
Versions: 4
Compression:
Stored size: 554 Bytes
Contents
require 'iord/output_helper' module Iord class JsonOutput < ::Iord::OutputHelper def display(object, attrs) json = {} attrs.each do |attr| json[v.field_name(attr)] = v.field_value(object, attr) end return json end def display_array(array, attrs) json = [] array.each do |element| json << display(element, attrs) end return json end def link_to(label, url, hash) {url: url, label: label} end def image(url, hash) {image: url} end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
iord-1.1.0 | lib/iord/json_output.rb |
iord-1.0.3 | lib/iord/json_output.rb |
iord-1.0.2 | lib/iord/json_output.rb |
iord-1.0.1 | lib/iord/json_output.rb |