class OnlyofficePdfParser::CursorPoint

Class for working with cursor coordinates

Attributes

height[RW]
left[RW]
top[RW]
width[RW]
x[RW]
y[RW]

Public Class Methods

new(left, top) click to toggle source
# File lib/onlyoffice_pdf_parser/helpers/cursor_point.rb, line 8
def initialize(left, top)
  @left = left
  @top = top
end

Public Instance Methods

==(other) click to toggle source

Compare object with other @param other [Object] object to compare @return [True, False] result of comparison

# File lib/onlyoffice_pdf_parser/helpers/cursor_point.rb, line 32
def ==(other)
  if other.respond_to?(:left) && other.respond_to?(:top)
    @left == other.left && @top == other.top
  else
    false
  end
end
[](name) click to toggle source

Accessor of attributes like hash @param name [Symbol] attribute name @return [Object] value of attribute

# File lib/onlyoffice_pdf_parser/helpers/cursor_point.rb, line 43
def [](name)
  case name
  when :width
    left
  when :height
    top
  else
    'Unknown attribute'
  end
end
dup() click to toggle source

Make a copy of object @return [CursorPoint] another object

# File lib/onlyoffice_pdf_parser/helpers/cursor_point.rb, line 20
def dup
  CursorPoint.new(@left, @top)
end
to_s() click to toggle source

@return [String] convert object to string

# File lib/onlyoffice_pdf_parser/helpers/cursor_point.rb, line 25
def to_s
  "[#{@left}, #{@top}]"
end