Class: RBeautify::BlockEnd

Inherits:
Object show all
Defined in:
lib/ruby-beautify/lib/ruby-beautify/block_end.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(block_start, offset, match, after_match) ⇒ BlockEnd

Returns a new instance of BlockEnd.



7
8
9
10
11
12
# File 'lib/ruby-beautify/lib/ruby-beautify/block_end.rb', line 7

def initialize(block_start, offset, match, after_match)
  self.block_start = block_start
  self.offset = offset
  self.match = match
  self.after_match = after_match
end

Instance Attribute Details

#after_matchObject

Returns the value of attribute after_match.



5
6
7
# File 'lib/ruby-beautify/lib/ruby-beautify/block_end.rb', line 5

def after_match
  @after_match
end

#block_startObject

Returns the value of attribute block_start.



5
6
7
# File 'lib/ruby-beautify/lib/ruby-beautify/block_end.rb', line 5

def block_start
  @block_start
end

#matchObject

Returns the value of attribute match.



5
6
7
# File 'lib/ruby-beautify/lib/ruby-beautify/block_end.rb', line 5

def match
  @match
end

#offsetObject

Returns the value of attribute offset.



5
6
7
# File 'lib/ruby-beautify/lib/ruby-beautify/block_end.rb', line 5

def offset
  @offset
end

Instance Method Details

#end_can_also_be_start?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/ruby-beautify/lib/ruby-beautify/block_end.rb', line 18

def end_can_also_be_start?
  block_start.block_matcher.end_can_also_be_start?
end

#end_offsetObject



14
15
16
# File 'lib/ruby-beautify/lib/ruby-beautify/block_end.rb', line 14

def end_offset
  offset + match.length
end