Sha256: da16b9e567afd5064024dcb70d960e4dbde8110f43493c5a8417628585ba010f

Contents?: true

Size: 359 Bytes

Versions: 4

Compression:

Stored size: 359 Bytes

Contents

# frozen_string_literal: true

module Leftovers
  module AST
    class StrNode < Node
      alias_method :to_scalar_value, :first

      def name
        first.to_sym
      end

      alias_method :to_s, :first
      alias_method :to_literal_s, :to_s

      def to_sym
        to_s.to_sym
      end

      def scalar?
        true
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
leftovers-0.12.2 lib/leftovers/ast/str_node.rb
leftovers-0.12.1 lib/leftovers/ast/str_node.rb
leftovers-0.12.0 lib/leftovers/ast/str_node.rb
leftovers-0.11.2 lib/leftovers/ast/str_node.rb