Class: Kdep::YamlDuplicateKeys::Duplicate

Inherits:
Struct
  • Object
show all
Defined in:
lib/kdep/yaml_duplicate_keys.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#fileObject

Returns the value of attribute file

Returns:

  • (Object)

    the current value of file



21
22
23
# File 'lib/kdep/yaml_duplicate_keys.rb', line 21

def file
  @file
end

#first_lineObject

Returns the value of attribute first_line

Returns:

  • (Object)

    the current value of first_line



21
22
23
# File 'lib/kdep/yaml_duplicate_keys.rb', line 21

def first_line
  @first_line
end

#key_pathObject

Returns the value of attribute key_path

Returns:

  • (Object)

    the current value of key_path



21
22
23
# File 'lib/kdep/yaml_duplicate_keys.rb', line 21

def key_path
  @key_path
end

#repeat_lineObject

Returns the value of attribute repeat_line

Returns:

  • (Object)

    the current value of repeat_line



21
22
23
# File 'lib/kdep/yaml_duplicate_keys.rb', line 21

def repeat_line
  @repeat_line
end

Instance Method Details

#to_sObject



22
23
24
25
# File 'lib/kdep/yaml_duplicate_keys.rb', line 22

def to_s
  "#{file}:#{repeat_line} duplicate key '#{key_path}' (first declared at line " \
    "#{first_line}) -- YAML keeps the last block and discards the earlier one"
end