You have a Sequel::MySQL::Dataset
in @var
, you can see that from the puts @var
output. Sequel::MySQL::Dataset
gets its []
method from Sequel::Dateset
and that method:
- (Object)
[
](*conditions)Returns the first record matching the conditions. Examples:
DB[:table][:id=>1] # SELECT * FROM table WHERE (id = 1) LIMIT 1 # => {:id=1}
That means that @var[:system]
will give you a row, not a single value.
Perhaps you really want:
puts @var.first[:system]
to peel off the first (and only) row in the result set and then pull the :system
value out of that single row.