Sha256: e5f269073c71c149b93d74dde5dfb3f12c2fd21a3d4c9c91d8fb80567aa9096e

Contents?: true

Size: 582 Bytes

Versions: 11

Compression:

Stored size: 582 Bytes

Contents

module Turnip
  module Node
    #
    # @note Location metadata generated by Gherkin
    #
    #     {
    #       line: 10,
    #       column: 3
    #     }
    #
    class Location
      attr_reader :line,
                  :column

      def initialize(line, column)
        @line = line
        @column = column
      end
    end

    module HasLocation
      #
      # @return [Location]
      #
      def location
        @location ||= Location.new(@raw[:location][:line], @raw[:location][:column])
      end

      def line
        location.line
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
turnip-4.3.0 lib/turnip/node/location.rb
turnip-4.2.0 lib/turnip/node/location.rb
turnip-4.1.0 lib/turnip/node/location.rb
turnip-4.0.1 lib/turnip/node/location.rb
turnip-4.0.0 lib/turnip/node/location.rb
turnip-3.1.0 lib/turnip/node/location.rb
turnip-3.0.0 lib/turnip/node/location.rb
turnip-3.0.0.pre.beta.5 lib/turnip/node/location.rb
turnip-3.0.0.pre.beta.4 lib/turnip/node/location.rb
turnip-3.0.0.pre.beta.3 lib/turnip/node/location.rb
turnip-3.0.0.pre.beta.2 lib/turnip/node/location.rb