class CsvPack::Meta
Public Class Methods
load( text )
click to toggle source
todo: add alias method read
# File lib/csvpack/pack.rb, line 19 def self.load( text ) hash = JSON.parse( text ) new( hash ) end
load_file( path )
click to toggle source
# File lib/csvpack/pack.rb, line 13 def self.load_file( path ) text = File.open( path, 'r:utf-8' ).read load( text ) end
new( h )
click to toggle source
todo: add alias method parse
# File lib/csvpack/pack.rb, line 26 def initialize( h ) @h = h end
Public Instance Methods
license()
click to toggle source
# File lib/csvpack/pack.rb, line 32 def license() @h['license']; end
name()
click to toggle source
# File lib/csvpack/pack.rb, line 30 def name() @h['name']; end
pretty_print( printer )
click to toggle source
# File lib/csvpack/pack.rb, line 40 def pretty_print( printer ) printer.text "Meta<#{object_id} @h.name=#{name}, ...>" end
resources()
click to toggle source
todo/fix: wrap resource in a class - why? why not?
# File lib/csvpack/pack.rb, line 35 def resources() @h['resources']; end
title()
click to toggle source
# File lib/csvpack/pack.rb, line 31 def title() @h['title']; end