odata-model 0.0.2 → 0.0.3
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/query.rb +2 -1
- data/lib/odata/model/version.rb +1 -1
- data/lib/odata/query/builder.rb +10 -1
- data/odata-model.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83e49bd9f7c8f2d740de14d39b783fa5c15ae87c
|
4
|
+
data.tar.gz: 7293c767466539473d216cb3daddd8445ac91b19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b3ac6d07f37f8d07d4aadd50fded4e94f3c71ccd19c8d55b7701b26a97054d15785e83c34d2207b41997feca86255a14a511989ab32728625de72e404f4af6f
|
7
|
+
data.tar.gz: 30e92ac253e598e43f4f2fee80f23992395c882d5672cb8c6f26ca207899832e5caef0f61cf647515d125e9c39768834024220be99dac690d4e0830fe5be09b8
|
data/lib/odata/model/query.rb
CHANGED
@@ -7,6 +7,7 @@ module OData
|
|
7
7
|
# ...
|
8
8
|
end
|
9
9
|
|
10
|
+
# Methods mixed in at the class level.
|
10
11
|
module ClassMethods
|
11
12
|
# Starts a chain for building up an OData query.
|
12
13
|
# @return [OData::Query::Builder]
|
@@ -15,7 +16,7 @@ module OData
|
|
15
16
|
end
|
16
17
|
|
17
18
|
# Enables lookup of model entities by their primary key.
|
18
|
-
# @param [to_s] primary key value to lookup
|
19
|
+
# @param primary_key_value [to_s] primary key value to lookup
|
19
20
|
# @return [OData::Model,nil]
|
20
21
|
def [](primary_key_value)
|
21
22
|
entity = odata_entity_set[primary_key_value]
|
data/lib/odata/model/version.rb
CHANGED
data/lib/odata/query/builder.rb
CHANGED
@@ -1,15 +1,24 @@
|
|
1
1
|
module OData
|
2
2
|
class Query
|
3
|
+
# Provides a OData::Model aware means of building up queries using chained
|
4
|
+
# methods. Also implements the Enumerable module to support working with
|
5
|
+
# the results of any query in a sane way.
|
3
6
|
class Builder
|
7
|
+
include Enumerable
|
8
|
+
|
4
9
|
SUPPORTED_OPERATIONS = [:eq, :ne, :gt, :ge, :lt, :le, :not]
|
5
10
|
|
6
11
|
# Sets up a new Query Builder.
|
7
|
-
# @param
|
12
|
+
# @param model [OData::Model] the model to build the query for
|
8
13
|
def initialize(model)
|
9
14
|
@entity_set = model.odata_entity_set
|
10
15
|
@property_map = model.property_map
|
11
16
|
end
|
12
17
|
|
18
|
+
def each
|
19
|
+
# TODO implement
|
20
|
+
end
|
21
|
+
|
13
22
|
# Set the number of entities to skip for the final query.
|
14
23
|
# @param value [to_i,nil]
|
15
24
|
# @return [self]
|
data/odata-model.gemspec
CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_development_dependency 'codeclimate-test-reporter'
|
25
25
|
spec.add_development_dependency 'rspec', '~> 3.0.0'
|
26
26
|
|
27
|
-
spec.add_dependency 'odata', '~> 0.2
|
27
|
+
spec.add_dependency 'odata', '~> 0.2'
|
28
28
|
spec.add_dependency 'activesupport', '>= 3.0.0'
|
29
29
|
spec.add_dependency 'activemodel', '>= 3.0.0'
|
30
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: odata-model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Thompson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 0.2
|
89
|
+
version: '0.2'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 0.2
|
96
|
+
version: '0.2'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: activesupport
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|