Class: ROM::Yesql::Dataset Private

Inherits:
Object
  • Object
show all
Defined in:
lib/rom/yesql/dataset.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Yesql dataset simply uses a sequel connection to fetch results of a query

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ Dataset

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Dataset.



13
14
15
# File 'lib/rom/yesql/dataset.rb', line 13

def initialize(connection)
  @connection = connection
end

Instance Attribute Details

#connectionSequel::Database (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Sequel::Database)


10
11
12
# File 'lib/rom/yesql/dataset.rb', line 10

def connection
  @connection
end

Instance Method Details

#read(query) ⇒ Array<Hash>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Fetch results of a query using sequel connection

Returns:

  • (Array<Hash>)


22
23
24
# File 'lib/rom/yesql/dataset.rb', line 22

def read(query)
  connection.fetch(query)
end