Sha256: bfb8859a292472fcd2e3fe5889a25090007a55764d38b304a25585c2da92a917

Contents?: true

Size: 535 Bytes

Versions: 8

Compression:

Stored size: 535 Bytes

Contents

require 'json/ext'

module Hieracles
  module Formats
    # format intended to be used for an api server
    class Json < Hieracles::Format

      def info(_)
        @node.info.to_json
      end

      def files(_)
        @node.files.to_json
      end

      def paths(_)
        @node.paths.to_json
      end

      def modules(_)
        @node.modules.to_json
      end

      def params(args)
        @node.params(true).to_json
      end

      def allparams(args)
        @node.params(false).to_json
      end

    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
hieracles-0.2.0 lib/hieracles/formats/json.rb
hieracles-0.1.7 lib/hieracles/formats/json.rb
hieracles-0.1.6 lib/hieracles/formats/json.rb
hieracles-0.1.5 lib/hieracles/formats/json.rb
hieracles-0.1.4 lib/hieracles/formats/json.rb
hieracles-0.1.3 lib/hieracles/formats/json.rb
hieracles-0.1.2 lib/hieracles/formats/json.rb
hieracles-0.1.1 lib/hieracles/formats/json.rb