Class: ERBLint::Utils::BlockMap::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/erb_lint/utils/block_map.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_rangeObject (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

#nodeObject (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_rangeObject (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

Returns:

  • (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