-
Notifications
You must be signed in to change notification settings - Fork 503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I pulled down #set to GenericSpreedSheet #1
Changes from 2 commits
7463c34
ad9d36f
e700690
e8b37ee
79dd9a0
ac77954
c02cb21
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -159,6 +159,12 @@ def empty?(row, col, sheet=nil) | |
value.empty? | ||
end | ||
|
||
# sets the cell to the content of 'value' | ||
# a formula can be set in the form of '=SUM(...)' | ||
def set(row,col,value,sheet=nil) | ||
set_value(row,col,value,sheet=nil) | ||
end | ||
|
||
# sets the cell to the content of 'value' | ||
# a formula can be set in the form of '=SUM(...)' | ||
def set_value(row,col,value,sheet=nil) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the other types, set_value is private and set is the main api. Maybe we could print a deprecation message here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Besides the deprecation warning, we could rename #set_value to #_set_value and make private, the GenericSpreadSheet protocol is already broken at this class, so I don't think it would be a problem. |
||
|
@@ -223,6 +229,12 @@ def last_column(sheet=nil) | |
|
||
private | ||
|
||
def set_type(row,col,type,sheet=nil) | ||
sheet = @default_value unless sheet | ||
key = "#{row},#{col}" | ||
@cell_type[sheet][[key]] = type | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this extra [] around key is a bug. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep |
||
end | ||
|
||
# read all cells in a sheet. | ||
def read_cells(sheet=nil) | ||
sheet ||= @default_sheet | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sheet=nil in the call to set_value will override the sheet argument.