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.



15
16
17
# File 'lib/rom/yesql/dataset.rb', line 15

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)


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

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>)


24
25
26
# File 'lib/rom/yesql/dataset.rb', line 24

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