Sha256: fde92079a89f0eb93ca172a6e6e14e2d2d6336c0c62066dcc71ae4fd2e105198

Contents?: true

Size: 595 Bytes

Versions: 4

Compression:

Stored size: 595 Bytes

Contents

# frozen_string_literal: true

module Lino
  module Model
    class Argument
      attr_reader :argument

      def initialize(argument)
        @argument = argument
      end

      def string
        argument
      end
      alias to_s string

      def array
        [argument]
      end
      alias to_a string

      def ==(other)
        self.class == other.class &&
          state == other.state
      end
      alias eql? ==

      def hash
        [self.class, state].hash
      end

      protected

      def state
        [
          @argument
        ]
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lino-3.2.0.pre.9 lib/lino/model/argument.rb
lino-3.2.0.pre.8 lib/lino/model/argument.rb
lino-3.2.0.pre.7 lib/lino/model/argument.rb
lino-3.2.0.pre.6 lib/lino/model/argument.rb