Module: Kalimba::Persistence::ClassMethods
- Defined in:
- lib/kalimba/persistence.rb
Instance Method Summary collapse
- #all(options = {}) ⇒ Object
- #count(attributes = {}) ⇒ Object
-
#create(attributes = {}) ⇒ Resource?
Create a new instance of RDFS class.
-
#destroy_all ⇒ Boolean
Remove all instances of the RDFSClass from the repository.
-
#exist?(attributes = {}) ⇒ Boolean
Check whether instances of the RDFS class exist in the repository.
- #find(scope, options = {}) ⇒ Object
- #find_by_id(id_value) ⇒ Object
- #find_each(options = {}) ⇒ Object
- #first(options = {}) ⇒ Object
- #logger ⇒ Object
Instance Method Details
#all(options = {}) ⇒ Object
79 80 81 |
# File 'lib/kalimba/persistence.rb', line 79 def all( = {}) find(:all, ) end |
#count(attributes = {}) ⇒ Object
83 84 85 |
# File 'lib/kalimba/persistence.rb', line 83 def count(attributes = {}) raise NotImplementedError end |
#create(attributes = {}) ⇒ Resource?
Create a new instance of RDFS class
37 38 39 |
# File 'lib/kalimba/persistence.rb', line 37 def create(attributes = {}) raise NotImplementedError end |
#destroy_all ⇒ Boolean
Remove all instances of the RDFSClass from the repository
52 53 54 |
# File 'lib/kalimba/persistence.rb', line 52 def destroy_all raise NotImplementedError end |
#exist?(attributes = {}) ⇒ Boolean
Check whether instances of the RDFS class exist in the repository
45 46 47 |
# File 'lib/kalimba/persistence.rb', line 45 def exist?(attributes = {}) raise NotImplementedError end |
#find(scope, options = {}) ⇒ Object
56 57 58 59 60 61 62 63 64 65 |
# File 'lib/kalimba/persistence.rb', line 56 def find(scope, = {}) case scope when :first find_each(.merge(:limit => 1)).first when :all find_each().to_a else find_by_id(scope) end end |
#find_by_id(id_value) ⇒ Object
67 68 69 |
# File 'lib/kalimba/persistence.rb', line 67 def find_by_id(id_value) raise NotImplementedError end |
#find_each(options = {}) ⇒ Object
71 72 73 |
# File 'lib/kalimba/persistence.rb', line 71 def find_each( = {}) raise NotImplementedError end |
#first(options = {}) ⇒ Object
75 76 77 |
# File 'lib/kalimba/persistence.rb', line 75 def first( = {}) find(:first, ) end |
#logger ⇒ Object
87 88 89 |
# File 'lib/kalimba/persistence.rb', line 87 def logger Kalimba::Persistence.logger end |