Class: Furud::Adjustment
- Inherits:
-
Data
- Object
- Data
- Furud::Adjustment
- Defined in:
- lib/furud/types.rb,
sig/furud.rbs
Instance Attribute Summary collapse
-
#at ⇒ Object
readonly
Returns the value of attribute at.
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#sheet ⇒ Object
readonly
Returns the value of attribute sheet.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type:, sheet: nil, at:, count: 1) ⇒ Adjustment
constructor
A new instance of Adjustment.
Constructor Details
#initialize(type:, sheet: nil, at:, count: 1) ⇒ Adjustment
Returns a new instance of Adjustment.
47 48 49 50 51 52 53 54 |
# File 'lib/furud/types.rb', line 47 def initialize(type:, sheet: nil, at:, count: 1) type = type.to_sym raise ArgumentError, "type must be insert_rows, delete_rows, insert_columns, or delete_columns" unless i[insert_rows delete_rows insert_columns delete_columns].include?(type) raise ArgumentError, "at and count must be positive" unless Integer(at).positive? && Integer(count).positive? super(type: type, sheet: sheet&.to_s, at: Integer(at), count: Integer(count)) end |
Instance Attribute Details
#at ⇒ Object (readonly)
Returns the value of attribute at
46 47 48 |
# File 'lib/furud/types.rb', line 46 def at @at end |
#count ⇒ Object (readonly)
Returns the value of attribute count
46 47 48 |
# File 'lib/furud/types.rb', line 46 def count @count end |
#sheet ⇒ Object (readonly)
Returns the value of attribute sheet
46 47 48 |
# File 'lib/furud/types.rb', line 46 def sheet @sheet end |
#type ⇒ Object (readonly)
Returns the value of attribute type
46 47 48 |
# File 'lib/furud/types.rb', line 46 def type @type end |