Sha256: a015f0cc2159a9b8b5a9e0211004a2fc33d62c62fa1c4d90df178d901fc87057

Contents?: true

Size: 864 Bytes

Versions: 12

Compression:

Stored size: 864 Bytes

Contents

# frozen_string_literal: true

module Quby
  module Questionnaires
    module DSL
      # Deprecated, precompile elsewhere and use from_json
      def self.build_from_definition(definition)
        compiled = Quby::Compiler.compile(definition.key, definition.sourcecode, lookup_tables: {}, path: definition.path)
        data = JSON.parse(compiled[:outputs][:quby_frontend_v1].content)
        Deserializer.from_json(data)
      end

      # Deprecated, precompile elsewhere and use from_json
      def self.build(key, sourcecode = nil, timestamp: nil, &block)
        compiled = Quby::Compiler.compile(key, sourcecode, lookup_tables: {}, &block)
        data = JSON.parse(compiled[:outputs][:quby_frontend_v1].content)
        Deserializer.from_json(data)
      end

      def self.from_json(hash)
        Deserializer.from_json(hash)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
quby-5.6.5 lib/quby/questionnaires/dsl.rb
quby-5.6.3 lib/quby/questionnaires/dsl.rb
quby-5.6.2 lib/quby/questionnaires/dsl.rb
quby-5.6.1 lib/quby/questionnaires/dsl.rb
quby-5.6.0 lib/quby/questionnaires/dsl.rb
quby-5.5.0 lib/quby/questionnaires/dsl.rb
quby-5.4.0 lib/quby/questionnaires/dsl.rb
quby-5.3.1 lib/quby/questionnaires/dsl.rb
quby-5.3.0 lib/quby/questionnaires/dsl.rb
quby-5.2.0 lib/quby/questionnaires/dsl.rb
quby-5.1.3 lib/quby/questionnaires/dsl.rb
quby-5.1.2 lib/quby/questionnaires/dsl.rb