Module: Ansr::Dpla::Model::Querying::ClassMethods
- Defined in:
- lib/ansr_dpla/model/querying.rb
Instance Method Summary collapse
- #api ⇒ Object
- #api=(api) ⇒ Object
- #build_default_scope ⇒ Object
- #connection_handler ⇒ Object
- #references ⇒ Object
Instance Method Details
#api ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/ansr_dpla/model/querying.rb', line 12 def api @api ||= begin a = (config[:api] || Ansr::Dpla::Api).new a.config{|x| x.merge!(self.config)} a end end |
#api=(api) ⇒ Object
20 21 22 |
# File 'lib/ansr_dpla/model/querying.rb', line 20 def api=(api) @api = api end |
#build_default_scope ⇒ Object
8 9 10 |
# File 'lib/ansr_dpla/model/querying.rb', line 8 def build_default_scope Ansr::Dpla::Relation.new(model(), table()) end |
#connection_handler ⇒ Object
24 25 26 |
# File 'lib/ansr_dpla/model/querying.rb', line 24 def connection_handler @connection_handler ||= Ansr::Model::ConnectionHandler.new(Ansr::Dpla::ConnectionAdapters::NoSqlAdapter) end |
#references ⇒ Object
28 29 30 |
# File 'lib/ansr_dpla/model/querying.rb', line 28 def references ['provider', 'object'] end |