Class: OfIf::File::Line

Inherits:
Struct
  • Object
show all
Defined in:
lib/of_if/file.rb

Overview

Line responds to content and indentation length of a single line.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#rawObject

Returns the value of attribute raw

Returns:

  • (Object)

    the current value of raw



8
9
10
# File 'lib/of_if/file.rb', line 8

def raw
  @raw
end

Instance Method Details

#comment?Boolean

Returns:

  • (Boolean)


9
# File 'lib/of_if/file.rb', line 9

def comment? = raw.lstrip.start_with?('#')

#content_lengthObject



11
# File 'lib/of_if/file.rb', line 11

def content_length = raw.lstrip.length

#indent_lengthObject



12
# File 'lib/of_if/file.rb', line 12

def indent_length = length - content_length

#lengthObject



10
# File 'lib/of_if/file.rb', line 10

def length = raw.length