apphoshies-ruby-client 0.3.1 → 0.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.txt CHANGED
@@ -8,3 +8,11 @@
8
8
 
9
9
  * Config loading improvements (for Rails)
10
10
  * New helper methods in Document
11
+
12
+ === 0.3.1
13
+
14
+ * Bugfixes
15
+
16
+ === 0.3.9
17
+
18
+ * Pre-Release for automatic getters/setters on documents
@@ -26,4 +26,27 @@ class ApphoshiesClient::Document < ActiveResource::Base
26
26
  return v.first.send(key.to_sym) if v and v.any?
27
27
  end
28
28
  end
29
+
30
+ def set_value(key, value)
31
+ _values = self.values.collect {|v| v.attributes}
32
+ if value.is_a?(String)
33
+ _values << {key => value, "type" => value.class.name.to_s}
34
+ # TODO check other types!
35
+ else
36
+ raise "Value type not supported yet!"
37
+ end
38
+ self.values = _values
39
+ end
40
+
41
+ def method_missing(m, *args, &block)
42
+ unless m.to_s == ('values')
43
+ _object = get_value(m.to_s)
44
+ return _object if _object
45
+ end
46
+ begin
47
+ super(m, *args, &block)
48
+ rescue => e
49
+ return nil
50
+ end
51
+ end
29
52
  end
@@ -2,7 +2,7 @@ $:.unshift(File.dirname(__FILE__)) unless
2
2
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
3
 
4
4
  module ApphoshiesClient
5
- VERSION = '0.3.1'
5
+ VERSION = '0.3.9'
6
6
  end
7
7
 
8
8
  require "rubygems"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apphoshies-ruby-client
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 1
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 1
10
- version: 0.3.1
9
+ - 9
10
+ version: 0.3.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Oliver Kiessler
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-06 00:00:00 +01:00
18
+ date: 2010-11-07 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency