Class: Jylis::DataType::Base
- Inherits:
-
Object
- Object
- Jylis::DataType::Base
- Defined in:
- lib/jylis-rb/data_types/base.rb
Overview
A base data type for others to inherit shared logic from. This class can’t be instantiated directly.
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
The Jylis::Connection to use for queries.
Instance Method Summary collapse
-
#initialize(connection) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(connection) ⇒ Base
Returns a new instance of Base.
13 14 15 16 17 18 19 20 21 |
# File 'lib/jylis-rb/data_types/base.rb', line 13 def initialize(connection) if self.class == Base raise "Base is an abstract class and must be inherited" end raise ArgumentError.new("Connection can't be nil") unless connection @connection = connection end |
Instance Attribute Details
#connection ⇒ Object (readonly)
The Jylis::Connection to use for queries.
10 11 12 |
# File 'lib/jylis-rb/data_types/base.rb', line 10 def connection @connection end |