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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e8977c91a1477a037fa1c11304d27f1905878c65
4
- data.tar.gz: 12e47015a6ef55e1ae46dd84c0f1e59787da99d4
3
+ metadata.gz: 1ae5400c97d82391f59ffcab1411c2f14407dae7
4
+ data.tar.gz: 823547446b0e86673b988279df81dc4924e09e0a
5
5
  SHA512:
6
- metadata.gz: 1040af8022e03afe014c6f400503fadb3103b4498b820f829a8f2c68a9fbb1a1a330b3d8639d19087b191ce1553db36234e91d5a2749ee63f1baaec5fcfc49c7
7
- data.tar.gz: a1b44844fb074dac5012ba8f32afcda1c1a17448c842f2b22a355a1f59323a0405ad6ceda58d50616d8263306501dc69e7af7e37aa8e3c6a1944d73829f6461c
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?
@@ -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]
@@ -1,5 +1,5 @@
1
1
  module OData
2
2
  module Model
3
- VERSION = '0.5.17'
3
+ VERSION = '0.5.18'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: odata-model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.17
4
+ version: 0.5.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Thompson