Sha256: 989d9e1b6291330b19bf1579a83957d846ff6c23f505cfb30d89c7beb2c62b71
Contents?: true
Size: 607 Bytes
Versions: 11
Compression:
Stored size: 607 Bytes
Contents
# frozen_string_literal: true module Grumlin class TypedValue attr_reader :type, :value def initialize(type: nil, value: nil) @type = type @value = value end def to_bytecode @to_bytecode ||= if type.nil? value else { "@type": "g:#{type}", "@value": value } end end def inspect "<#{type}.#{value}>" end alias to_s inspect alias to_readable_bytecode inspect end end
Version data entries
11 entries across 11 versions & 1 rubygems