odata-model 0.5.17 → 0.5.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/odata/model/persistence.rb +12 -0
- data/lib/odata/model/query.rb +6 -0
- data/lib/odata/model/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ae5400c97d82391f59ffcab1411c2f14407dae7
|
4
|
+
data.tar.gz: 823547446b0e86673b988279df81dc4924e09e0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c874f1b14ecddd0bfedb0f17b9f3149e20e8970148bef49814862f3199104a1408e27f0afd63f00c4a62bea1d0bcc5356f81e60bd342ff534fecc64947503f72
|
7
|
+
data.tar.gz: 7273bb545963b8160e9213fa29ae0feb47cd19286f6302f64de25f0cb03e4a0ae498a727e549eb369aea33da445fe7e8d253f4e24f14c6ed2962c98168e3177f
|
@@ -10,6 +10,18 @@ module OData
|
|
10
10
|
# ...
|
11
11
|
end
|
12
12
|
|
13
|
+
# A simple initializer that just accepts a hash and sets any matching
|
14
|
+
# accessors with the supplied value
|
15
|
+
def initialize(attr_values = {})
|
16
|
+
attr_values.each do |attr_name, value|
|
17
|
+
begin
|
18
|
+
send("#{attr_name.to_sym}=", value)
|
19
|
+
rescue NoMethodError
|
20
|
+
next
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
13
25
|
# Returns whether the current instance has been persisted.
|
14
26
|
# @return [Boolean]
|
15
27
|
def persisted?
|
data/lib/odata/model/query.rb
CHANGED
@@ -10,6 +10,12 @@ module OData
|
|
10
10
|
|
11
11
|
# Methods mixed in at the class level.
|
12
12
|
module ClassMethods
|
13
|
+
# Gives you a handle to get at everything as an Enumerable
|
14
|
+
# @return [OData::Model::Query]
|
15
|
+
def all
|
16
|
+
OData::Model::QueryProxy.new(self)
|
17
|
+
end
|
18
|
+
|
13
19
|
# Starts a query chain with a filter for a given property's name.
|
14
20
|
# @param property_name [Hash,to_sym]
|
15
21
|
# @return [OData::Model::Query]
|
data/lib/odata/model/version.rb
CHANGED