| Class | Rfm::Result::ResultSet |
| In: |
lib/rfm_result.rb
|
| Parent: | Array |
The ResultSet object represents a set of records in FileMaker. It is, in every way, a real Ruby Array, so everything you expect to be able to do with an Array can be done with a ResultSet as well. In this case, the elements in the array are Record objects.
Here’s a typical example, displaying the results of a Find:
myServer = Rfm::Server.new(...)
results = myServer["Customers"]["Details"].find("First Name" => "Bill")
results.each {|record|
puts record["First Name"]
puts record["Last Name"]
puts record["Email Address"]
}
The ResultSet object has several useful attributes:
| date_format | [R] | |
| fields | [R] | |
| layout | [R] | |
| portals | [R] | |
| server | [R] | |
| time_format | [R] | |
| timestamp_format | [R] |
Initializes a new ResultSet object. You will probably never do this your self (instead, use the Layout object to get various ResultSet obejects).
If you feel so inclined, though, pass a Server object, and some fmpxmlresult compliant XML in a String.
The ResultSet object includes several useful attributes:
Note: keys in the fields hash are downcased for convenience (and [] automatically downcases on lookup, so it should be seamless). But if you each a field hash and need to know a field’s real name, with correct case, do +myField.name+ instead of relying on the key in the hash.