Class: I18nChecker::Cache::Line
- Inherits:
-
Object
- Object
- I18nChecker::Cache::Line
- Defined in:
- lib/i18n_checker/cache.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
Instance Method Summary collapse
- #[](range) ⇒ Object
- #columns_of(range) ⇒ Object
-
#initialize(line_number, content) ⇒ Line
constructor
A new instance of Line.
- #start_of(text, at = 0) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(line_number, content) ⇒ Line
Returns a new instance of Line.
101 102 103 104 |
# File 'lib/i18n_checker/cache.rb', line 101 def initialize(line_number, content) @line = line_number @content = content end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
99 100 101 |
# File 'lib/i18n_checker/cache.rb', line 99 def content @content end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
99 100 101 |
# File 'lib/i18n_checker/cache.rb', line 99 def line @line end |
Instance Method Details
#[](range) ⇒ Object
106 107 108 |
# File 'lib/i18n_checker/cache.rb', line 106 def [](range) columns_of(range) end |
#columns_of(range) ⇒ Object
110 111 112 |
# File 'lib/i18n_checker/cache.rb', line 110 def columns_of(range) content[range.first - 1, range.last] end |
#start_of(text, at = 0) ⇒ Object
114 115 116 |
# File 'lib/i18n_checker/cache.rb', line 114 def start_of(text, at = 0) content.index(text, at) end |
#to_s ⇒ Object
118 119 120 |
# File 'lib/i18n_checker/cache.rb', line 118 def to_s content end |