rubyXL icon indicating copy to clipboard operation
rubyXL copied to clipboard

Rubyfied method names

Open humiki opened this issue 11 years ago • 1 comments

I'd like to suggest adding Ruby-like aliases for a number of methods that do not conform to the usual Ruby style. For instance:

is_struckthrough          =>  struckthrough?
get_row_height(0)         =>  row_height(0)
change_row_height(0, 30)  =>  row_height(0, 30)
worksheet.sheet_data[0]   =>  worksheet.rows[0]

There are a lot more, but you get the idea.

humiki avatar Nov 24 '14 14:11 humiki

These issues stem from the very start of this gem, which was not really designed — just pretty much quickly thrown together. For the past year, I've been untangling the code and redoing the interfaces. On one hand, I'm open to changing the API; on the other, it should be approached carefully.

RubyXL provides two types of interfaces:

  • Complete Low-level access to the contents of XLSX file (the user must understand its structure) — worksheet.sheet_data is one such accessor (in fact, it accesses the content object for the sheet; and it is not equivalent to worksheet.rows[0]);
  • Selective high-level access to the contents of worksheets (the user does not have to understand anything beyond what Excel user does).

If you feel like helping with straightening things out, you are more than welcome to propose the "ideal" API, and I will very likely implement that.

weshatheleopard avatar Nov 24 '14 16:11 weshatheleopard