Class: GitSpelunk::Offset::Chunk::LineBlock

Inherits:
Struct
  • Object
show all
Defined in:
lib/git_spelunk/offset.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(offset, line) ⇒ LineBlock

Returns a new instance of LineBlock.



66
67
68
# File 'lib/git_spelunk/offset.rb', line 66

def initialize(offset, line)
  super(offset, [line])
end

Instance Attribute Details

#dataObject

Returns the value of attribute data

Returns:

  • (Object)

    the current value of data



65
66
67
# File 'lib/git_spelunk/offset.rb', line 65

def data
  @data
end

#offsetObject

Returns the value of attribute offset

Returns:

  • (Object)

    the current value of offset



65
66
67
# File 'lib/git_spelunk/offset.rb', line 65

def offset
  @offset
end

Instance Method Details

#<<(other) ⇒ Object



78
79
80
# File 'lib/git_spelunk/offset.rb', line 78

def <<(other)
  data << other
end

#sizeObject



74
75
76
# File 'lib/git_spelunk/offset.rb', line 74

def size
  data.size
end

#typeObject



70
71
72
# File 'lib/git_spelunk/offset.rb', line 70

def type
  data.first.line_origin
end