Class: ROM::Files::Gateway
- Inherits:
-
Gateway
- Object
- Gateway
- ROM::Files::Gateway
- Extended by:
- Forwardable
- Defined in:
- lib/rom/files/gateway.rb
Overview
Files gateway interface
Instance Attribute Summary collapse
- #connection ⇒ Connection readonly
-
#logger ⇒ Object
readonly
Default logger.
Instance Method Summary collapse
- #[] ⇒ Object
- #dataset(name) ⇒ Dataset
- #dataset? ⇒ Object
-
#initialize(root = Pathname.pwd, extensions: []) ⇒ Gateway
constructor
A new instance of Gateway.
-
#use_logger(logger) ⇒ Object
Set default logger for the gateway.
Constructor Details
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns default logger.
35 36 37 |
# File 'lib/rom/files/gateway.rb', line 35 def logger @logger end |
Instance Method Details
#[] ⇒ Object
55 |
# File 'lib/rom/files/gateway.rb', line 55 def_instance_delegators :connection, :[] |
#dataset(name) ⇒ Dataset
48 49 50 |
# File 'lib/rom/files/gateway.rb', line 48 def dataset(name) self[name] || connection.create_dataset(name) end |
#dataset? ⇒ Object
60 |
# File 'lib/rom/files/gateway.rb', line 60 def_instance_delegator :connection, :key?, :dataset? |
#use_logger(logger) ⇒ Object
Set default logger for the gateway
42 43 44 |
# File 'lib/rom/files/gateway.rb', line 42 def use_logger(logger) @logger = logger end |