Class: TalkToYourApp::ConnectionRegistry::ConnectionSpec
- Inherits:
-
Struct
- Object
- Struct
- TalkToYourApp::ConnectionRegistry::ConnectionSpec
- Defined in:
- lib/talk_to_your_app/connection_registry.rb
Overview
One declared connection. ‘database` is a database.yml config key; `role` is :reading or :writing. A :reading connection prevents writes at the Rails layer (defense in depth on top of a genuinely read-only DB role).
Instance Attribute Summary collapse
-
#database ⇒ Object
Returns the value of attribute database.
-
#name ⇒ Object
Returns the value of attribute name.
-
#replica ⇒ Object
Returns the value of attribute replica.
-
#role ⇒ Object
Returns the value of attribute role.
-
#statement_timeout ⇒ Object
Returns the value of attribute statement_timeout.
Instance Method Summary collapse
Instance Attribute Details
#database ⇒ Object
Returns the value of attribute database
18 19 20 |
# File 'lib/talk_to_your_app/connection_registry.rb', line 18 def database @database end |
#name ⇒ Object
Returns the value of attribute name
18 19 20 |
# File 'lib/talk_to_your_app/connection_registry.rb', line 18 def name @name end |
#replica ⇒ Object
Returns the value of attribute replica
18 19 20 |
# File 'lib/talk_to_your_app/connection_registry.rb', line 18 def replica @replica end |
#role ⇒ Object
Returns the value of attribute role
18 19 20 |
# File 'lib/talk_to_your_app/connection_registry.rb', line 18 def role @role end |
#statement_timeout ⇒ Object
Returns the value of attribute statement_timeout
18 19 20 |
# File 'lib/talk_to_your_app/connection_registry.rb', line 18 def statement_timeout @statement_timeout end |
Instance Method Details
#prevent_writes? ⇒ Boolean
23 24 25 |
# File 'lib/talk_to_your_app/connection_registry.rb', line 23 def prevent_writes? reading? end |
#reading? ⇒ Boolean
19 20 21 |
# File 'lib/talk_to_your_app/connection_registry.rb', line 19 def reading? role == :reading end |