class Fixturex::FixtureLocation

Attributes

name[R]
path[R]

Public Class Methods

new(path, name, line = nil) click to toggle source
# File lib/fixturex/fixture_location.rb, line 5
def initialize(path, name, line = nil)
  @path = path
  @name = name
  @line = line
end

Public Instance Methods

line() click to toggle source
# File lib/fixturex/fixture_location.rb, line 11
def line
  @line ||= File.readlines(path).index do |line|
    line.match?(/^#{name}:/)
  end + 1
end
to_h() click to toggle source
# File lib/fixturex/fixture_location.rb, line 17
def to_h
  {
    name: name,
    path: path.to_s,
    line: line
  }
end