Sha256: 7a0919e2472772ee178e08c0efb52d01fe524c2e5fd40e624024aeae79867b71

Contents?: true

Size: 516 Bytes

Versions: 19

Compression:

Stored size: 516 Bytes

Contents

module Nucleon
module Translator
class Json < Plugin::Translator
   
  #-----------------------------------------------------------------------------
  # Translator operations
   
  def parse(json_text)
    return super do |properties|
      if json_text && ! json_text.empty?
        properties = Util::Data.parse_json(json_text)
      end
      properties
    end
  end
  
  #---
  
  def generate(properties)
    return super do
      Util::Data.to_json(properties, get(:pretty, true))
    end
  end
end
end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
nucleon-0.1.19 lib/nucleon/translator/json.rb
nucleon-0.1.18 lib/nucleon/translator/json.rb
nucleon-0.1.17 lib/nucleon/translator/json.rb
nucleon-0.1.16 lib/nucleon/translator/json.rb
nucleon-0.1.15 lib/nucleon/translator/json.rb
nucleon-0.1.14 lib/nucleon/translator/json.rb
nucleon-0.1.13 lib/nucleon/translator/json.rb
nucleon-0.1.12 lib/nucleon/translator/json.rb
nucleon-0.1.11 lib/nucleon/translator/json.rb
nucleon-0.1.10 lib/nucleon/translator/json.rb
nucleon-0.1.9 lib/nucleon/translator/json.rb
nucleon-0.1.8 lib/nucleon/translator/json.rb
nucleon-0.1.7 lib/nucleon/translator/json.rb
nucleon-0.1.6 lib/nucleon/translator/json.rb
nucleon-0.1.5 lib/nucleon/translator/json.rb
nucleon-0.1.4 lib/nucleon/translator/json.rb
nucleon-0.1.3 lib/nucleon/translator/json.rb
nucleon-0.1.2 lib/nucleon/translator/json.rb
nucleon-0.1.1 lib/nucleon/translator/json.rb