Class: Dao::Gateway::Base
- Inherits:
-
Object
- Object
- Dao::Gateway::Base
- Defined in:
- lib/dao/gateway/base.rb
Instance Attribute Summary collapse
-
#black_list_attributes ⇒ Object
readonly
Returns the value of attribute black_list_attributes.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#transformer ⇒ Object
readonly
Returns the value of attribute transformer.
Instance Method Summary collapse
- #add_relations(scope, _relations, _options) ⇒ Object
- #chain(_scope, _method_name, _args, &_block) ⇒ Object
- #delete(_domain_id) ⇒ Object
-
#initialize(source, transformer) ⇒ Base
constructor
A new instance of Base.
- #map(object, associations) ⇒ Object
- #save!(_domain, _attributes) ⇒ Object
- #serializable_relations(relations) ⇒ Object
- #with_lock(_id, *_args, &_block) ⇒ Object
- #with_transaction(&_block) ⇒ Object
Constructor Details
#initialize(source, transformer) ⇒ Base
Returns a new instance of Base.
6 7 8 9 10 11 |
# File 'lib/dao/gateway/base.rb', line 6 def initialize(source, transformer) @source = source @transformer = transformer @black_list_attributes = @transformer.export_attributes_black_list end |
Instance Attribute Details
#black_list_attributes ⇒ Object (readonly)
Returns the value of attribute black_list_attributes.
4 5 6 |
# File 'lib/dao/gateway/base.rb', line 4 def black_list_attributes @black_list_attributes end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
4 5 6 |
# File 'lib/dao/gateway/base.rb', line 4 def source @source end |
#transformer ⇒ Object (readonly)
Returns the value of attribute transformer.
4 5 6 |
# File 'lib/dao/gateway/base.rb', line 4 def transformer @transformer end |
Instance Method Details
#add_relations(scope, _relations, _options) ⇒ Object
29 30 31 |
# File 'lib/dao/gateway/base.rb', line 29 def add_relations(scope, _relations, ) scope end |
#chain(_scope, _method_name, _args, &_block) ⇒ Object
25 26 27 |
# File 'lib/dao/gateway/base.rb', line 25 def chain(_scope, _method_name, _args, &_block) fail 'chain is not implemented' end |
#delete(_domain_id) ⇒ Object
21 22 23 |
# File 'lib/dao/gateway/base.rb', line 21 def delete(_domain_id) fail 'delete is not implemented' end |
#map(object, associations) ⇒ Object
13 14 15 |
# File 'lib/dao/gateway/base.rb', line 13 def map(object, associations) import(object, associations) end |
#save!(_domain, _attributes) ⇒ Object
17 18 19 |
# File 'lib/dao/gateway/base.rb', line 17 def save!(_domain, _attributes) fail 'save! is not implemented' end |
#serializable_relations(relations) ⇒ Object
41 42 43 |
# File 'lib/dao/gateway/base.rb', line 41 def serializable_relations(relations) convert_array(relations) end |
#with_lock(_id, *_args, &_block) ⇒ Object
37 38 39 |
# File 'lib/dao/gateway/base.rb', line 37 def with_lock(_id, *_args, &_block) raise LockNotSupported end |
#with_transaction(&_block) ⇒ Object
33 34 35 |
# File 'lib/dao/gateway/base.rb', line 33 def with_transaction(&_block) raise TransactionNotSupported end |