Sha256: 09e2bb910d9714af88493e688cc0fabebb50025bd10715ec1eaa0c57a63c3696

Contents?: true

Size: 529 Bytes

Versions: 1

Compression:

Stored size: 529 Bytes

Contents

# # frozen_string_literal: true

module Forthic
  class Variable
    attr_accessor :name, :value

    # @param [String] name
    # @param [Object] value
    def initialize(name, value = nil)
      @name = name
      @value = value
    end

    # @return [String]
    def get_name
      @name
    end

    # @param [Object] val
    def set_value(val)
      @value = val
    end

    # @return [Object]
    def get_value
      @value
    end

    # @return [Variable]
    def dup
      Variable.new(@name, @value)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
forthic-0.1.0 lib/forthic/variable.rb