Class: ERBLint::Utils::BlockMap::Entry
- Inherits:
-
Object
- Object
- ERBLint::Utils::BlockMap::Entry
- Defined in:
- lib/erb_lint/utils/block_map.rb
Instance Attribute Summary collapse
-
#erb_range ⇒ Object
readonly
Returns the value of attribute erb_range.
-
#node ⇒ Object
readonly
Returns the value of attribute node.
-
#ruby_range ⇒ Object
readonly
Returns the value of attribute ruby_range.
Instance Method Summary collapse
- #contains_ruby_range?(range) ⇒ Boolean
-
#initialize(node, ruby_range) ⇒ Entry
constructor
A new instance of Entry.
Constructor Details
#initialize(node, ruby_range) ⇒ Entry
Returns a new instance of Entry.
35 36 37 38 39 |
# File 'lib/erb_lint/utils/block_map.rb', line 35 def initialize(node, ruby_range) @node = node @erb_range = node.loc.range @ruby_range = ruby_range end |
Instance Attribute Details
#erb_range ⇒ Object (readonly)
Returns the value of attribute erb_range.
33 34 35 |
# File 'lib/erb_lint/utils/block_map.rb', line 33 def erb_range @erb_range end |
#node ⇒ Object (readonly)
Returns the value of attribute node.
33 34 35 |
# File 'lib/erb_lint/utils/block_map.rb', line 33 def node @node end |
#ruby_range ⇒ Object (readonly)
Returns the value of attribute ruby_range.
33 34 35 |
# File 'lib/erb_lint/utils/block_map.rb', line 33 def ruby_range @ruby_range end |
Instance Method Details
#contains_ruby_range?(range) ⇒ Boolean
41 42 43 |
# File 'lib/erb_lint/utils/block_map.rb', line 41 def contains_ruby_range?(range) range.begin >= @ruby_range.begin && range.end <= @ruby_range.end end |