Sha256: effb37681dd1a29d9d1b983ebd453010815932188902fa80d9327d21f2981344

Contents?: true

Size: 335 Bytes

Versions: 4

Compression:

Stored size: 335 Bytes

Contents

# frozen_string_literal: true

module Grumlin
  # TODO: find a better name
  class TypedValue
    def initialize(type, value)
      @type = type
      @value = value
    end

    def inspect(*)
      "#{@type}.#{@value}"
    end

    def to_bytecode
      @to_bytecode ||= { "@type": "g:#{@type}", "@value": @value }
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
grumlin-0.7.0 lib/grumlin/typed_value.rb
grumlin-0.6.2 lib/grumlin/typed_value.rb
grumlin-0.6.1 lib/grumlin/typed_value.rb
grumlin-0.6.0 lib/grumlin/typed_value.rb