Class: VER::Bookmarks::Bookmark

Inherits:
Struct
  • Object
show all
Includes:
Comparable
Defined in:
lib/ver/methods/bookmark.rb

Constant Summary

Constants inherited from Struct

Struct::CACHE

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Struct

new

Instance Attribute Details

#charObject

Returns the value of attribute char

Returns:

  • (Object)

    the current value of char



181
182
183
# File 'lib/ver/methods/bookmark.rb', line 181

def char
  @char
end

#fileObject

Returns the value of attribute file

Returns:

  • (Object)

    the current value of file



181
182
183
# File 'lib/ver/methods/bookmark.rb', line 181

def file
  @file
end

#lineObject

Returns the value of attribute line

Returns:

  • (Object)

    the current value of line



181
182
183
# File 'lib/ver/methods/bookmark.rb', line 181

def line
  @line
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



181
182
183
# File 'lib/ver/methods/bookmark.rb', line 181

def name
  @name
end

Instance Method Details

#<=>(other) ⇒ Object



184
185
186
# File 'lib/ver/methods/bookmark.rb', line 184

def <=>(other)
  [file, index] <=> [other.file, other.index]
end

#indexObject



188
189
190
# File 'lib/ver/methods/bookmark.rb', line 188

def index
  [line, char]
end

#index=(index) ⇒ Object



192
193
194
# File 'lib/ver/methods/bookmark.rb', line 192

def index=(index)
  self.line, self.char = *index
end

#to_aObject



196
197
198
# File 'lib/ver/methods/bookmark.rb', line 196

def to_a
  [name, file, *index]
end