Class: I18nContextGenerator::Searcher::DiscoveredLocalization
- Inherits:
-
Data
- Object
- Data
- I18nContextGenerator::Searcher::DiscoveredLocalization
- Defined in:
- lib/i18n_context_generator/searcher.rb
Overview
Represents a localization entry discovered directly from source code.
Instance Attribute Summary collapse
-
#comment ⇒ Object
readonly
Returns the value of attribute comment.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#location_groups ⇒ Object
readonly
Returns the value of attribute location_groups.
-
#locations ⇒ Object
readonly
Returns the value of attribute locations.
-
#resource_type ⇒ Object
readonly
Returns the value of attribute resource_type.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(key:, file:, line:, text: nil, comment: nil, resource_type: :string, locations: nil, location_groups: nil) ⇒ DiscoveredLocalization
constructor
A new instance of DiscoveredLocalization.
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
#comment ⇒ Object (readonly)
Returns the value of attribute comment
26 27 28 |
# File 'lib/i18n_context_generator/searcher.rb', line 26 def comment @comment end |
#file ⇒ Object (readonly)
Returns the value of attribute file
26 27 28 |
# File 'lib/i18n_context_generator/searcher.rb', line 26 def file @file end |
#key ⇒ Object (readonly)
Returns the value of attribute key
26 27 28 |
# File 'lib/i18n_context_generator/searcher.rb', line 26 def key @key end |
#line ⇒ Object (readonly)
Returns the value of attribute line
26 27 28 |
# File 'lib/i18n_context_generator/searcher.rb', line 26 def line @line end |
#location_groups ⇒ Object (readonly)
Returns the value of attribute location_groups
26 27 28 |
# File 'lib/i18n_context_generator/searcher.rb', line 26 def location_groups @location_groups end |
#locations ⇒ Object (readonly)
Returns the value of attribute locations
26 27 28 |
# File 'lib/i18n_context_generator/searcher.rb', line 26 def locations @locations end |
#resource_type ⇒ Object (readonly)
Returns the value of attribute resource_type
26 27 28 |
# File 'lib/i18n_context_generator/searcher.rb', line 26 def resource_type @resource_type end |
#text ⇒ Object (readonly)
Returns the value of attribute text
26 27 28 |
# File 'lib/i18n_context_generator/searcher.rb', line 26 def text @text end |