jarmo / RAutomation

RAutomation
MIT License
100 stars 33 forks source link

Table#strings #48

Closed leviwilson closed 11 years ago

leviwilson commented 11 years ago

Added some methods to the UiaDll to get headers and values back from a table. Then refactored the Table#strings method as well. As an aside, this pull request is setting up for something I want to be able to do with Table#row. I would like to be able to have this:

  table.headers # => ["Name", "Date of birth", "State"]

  first_row = table.row(:index => 0)
  row.name # => "John Doe"
  row.date_of_birth  # => "12/15/1967"
  row.state # => "FL"
jarmo commented 11 years ago

Havin an API you're describing above is not a good idea as also mentioned in the commit comments. There will be problems when column names have reserved keywords in them and so on. I would prefer #[] instead if doing something similar, so it would work like this or something similar:

row["name"]
row["date_of_birth"]
leviwilson commented 11 years ago

Good call on the reserved keywords. I'll keep that in mind when I add that later.

leviwilson commented 11 years ago

Updated the pull request per your suggestions.