Sha256: e25ae85bfa7e5c50928969fb75b640a2d1bef0d299fc7e5d68ede8fd03ffec1a

Contents?: true

Size: 377 Bytes

Versions: 4

Compression:

Stored size: 377 Bytes

Contents

# frozen_string_literal: true

module Leftovers
  module AST
    class StrNode < ::Leftovers::AST::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.11.1 lib/leftovers/ast/str_node.rb
leftovers-0.11.0 lib/leftovers/ast/str_node.rb
leftovers-0.10.0 lib/leftovers/ast/str_node.rb
leftovers-0.9.0 lib/leftovers/ast/str_node.rb