Class: Furud::Reference

Inherits:
Data
  • Object
show all
Defined in:
lib/furud/types.rb,
sig/furud.rbs

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sheet: nil, row:, column:, absolute_row: false, absolute_column: false) ⇒ Reference

Returns a new instance of Reference.

Parameters:

  • sheet: (String, nil) (defaults to: nil)
  • row: (Integer)
  • column: (Integer)
  • absolute_row: (Boolean) (defaults to: false)
  • absolute_column: (Boolean) (defaults to: false)

Raises:

  • (ArgumentError)


5
6
7
8
9
10
# File 'lib/furud/types.rb', line 5

def initialize(sheet: nil, row:, column:, absolute_row: false, absolute_column: false)
  raise ArgumentError, "row and column must be positive" unless row.to_i.positive? && column.to_i.positive?

  super(sheet: sheet&.to_s, row: Integer(row), column: Integer(column),
        absolute_row: !!absolute_row, absolute_column: !!absolute_column)
end

Instance Attribute Details

#absolute_column ⇒ Object (readonly)

Returns the value of attribute absolute_column

Returns:

  • (Object) —

    the current value of absolute_column



4
5
6
# File 'lib/furud/types.rb', line 4

def absolute_column
  @absolute_column
end

#absolute_row ⇒ Object (readonly)

Returns the value of attribute absolute_row

Returns:

  • (Object) —

    the current value of absolute_row



4
5
6
# File 'lib/furud/types.rb', line 4

def absolute_row
  @absolute_row
end

#column ⇒ Object (readonly)

Returns the value of attribute column

Returns:

  • (Object) —

    the current value of column



4
5
6
# File 'lib/furud/types.rb', line 4

def column
  @column
end

#row ⇒ Object (readonly)

Returns the value of attribute row

Returns:

  • (Object) —

    the current value of row



4
5
6
# File 'lib/furud/types.rb', line 4

def row
  @row
end

#sheet ⇒ Object (readonly)

Returns the value of attribute sheet

Returns:

  • (Object) —

    the current value of sheet



4
5
6
# File 'lib/furud/types.rb', line 4

def sheet
  @sheet
end

Instance Method Details

#with ⇒ Reference

Parameters:

  • (Object)

Returns:



18
# File 'sig/furud.rbs', line 18

def with: (**untyped) -> Reference