Class: I18nContextGenerator::Searcher::DiscoveredLocalization

Inherits:
Data
  • Object
show all
Defined in:
lib/i18n_context_generator/searcher.rb

Overview

Represents a localization entry discovered directly from source code.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key:, file:, line:, text: nil, comment: nil, resource_type: :string, locations: nil, location_groups: nil) ⇒ DiscoveredLocalization

Returns a new instance of DiscoveredLocalization.



29
30
31
32
33
34
# File 'lib/i18n_context_generator/searcher.rb', line 29

def initialize(key:, file:, line:, text: nil, comment: nil, resource_type: :string, locations: nil,
               location_groups: nil)
  locations ||= ["#{file}:#{line}"]
  location_groups ||= [locations]
  super
end

Instance Attribute Details

#commentObject (readonly)

Returns the value of attribute comment

Returns:

  • (Object)

    the current value of comment



26
27
28
# File 'lib/i18n_context_generator/searcher.rb', line 26

def comment
  @comment
end

#fileObject (readonly)

Returns the value of attribute file

Returns:

  • (Object)

    the current value of file



26
27
28
# File 'lib/i18n_context_generator/searcher.rb', line 26

def file
  @file
end

#keyObject (readonly)

Returns the value of attribute key

Returns:

  • (Object)

    the current value of key



26
27
28
# File 'lib/i18n_context_generator/searcher.rb', line 26

def key
  @key
end

#lineObject (readonly)

Returns the value of attribute line

Returns:

  • (Object)

    the current value of line



26
27
28
# File 'lib/i18n_context_generator/searcher.rb', line 26

def line
  @line
end

#location_groupsObject (readonly)

Returns the value of attribute location_groups

Returns:

  • (Object)

    the current value of location_groups



26
27
28
# File 'lib/i18n_context_generator/searcher.rb', line 26

def location_groups
  @location_groups
end

#locationsObject (readonly)

Returns the value of attribute locations

Returns:

  • (Object)

    the current value of locations



26
27
28
# File 'lib/i18n_context_generator/searcher.rb', line 26

def locations
  @locations
end

#resource_typeObject (readonly)

Returns the value of attribute resource_type

Returns:

  • (Object)

    the current value of resource_type



26
27
28
# File 'lib/i18n_context_generator/searcher.rb', line 26

def resource_type
  @resource_type
end

#textObject (readonly)

Returns the value of attribute text

Returns:

  • (Object)

    the current value of text



26
27
28
# File 'lib/i18n_context_generator/searcher.rb', line 26

def text
  @text
end