calculated 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -0,0 +1,6 @@
1
+ == 0.1.2
2
+
3
+ * Added new API methods
4
+ * object_template find
5
+ * relatable category find
6
+ * relatable categories
@@ -6,7 +6,8 @@ module Calculated
6
6
  property :id # [String]
7
7
  property :name # [String]
8
8
  property :related_attribute # [String]
9
- property :related_object_name # [String]
9
+ property :related_object_name # [String]
10
+ property :related_objects # [Hash{name => <Hash{:id => identifier}}]
10
11
  # @example
11
12
  # "emission_source" => {
12
13
  # {
@@ -1,5 +1,15 @@
1
1
  module Calculated
2
- module ObjectTemplateApiCalls
2
+ module ObjectTemplateApiCalls
3
+
4
+
5
+ # @param [String] id
6
+ # @param [Hash] params
7
+ # @return [Calculated::Models::ObjectTemplate]
8
+ def object_template(id, params = {})
9
+ api_call(:get, "/object_templates/#{id}", params) do |response|
10
+ Calculated::Models::ObjectTemplate.new(response["object_template"])
11
+ end
12
+ end
3
13
 
4
14
  # @param [Hash] params
5
15
  # @return [Array<Calculated::Models::ObjectTemplate>]
@@ -1,5 +1,23 @@
1
1
  module Calculated
2
- module RelatableCategoryApiCalls
2
+ module RelatableCategoryApiCalls
3
+
4
+
5
+ # @param [String] id
6
+ # @param [Hash] params
7
+ # @return [Calculated::Models::RelatableCategory]
8
+ def relatable_category(id, params = {})
9
+ api_call(:get, "/relatable_categories/#{id}", params) do |response|
10
+ Calculated::Models::RelatableCategory.new(response["relatable_category"])
11
+ end
12
+ end
13
+
14
+ # @param [Hash] params
15
+ # @return [Array<Calculated::Models::RelatableCategory>
16
+ def relatable_categories(params = {})
17
+ api_call(:get, "/relatable_categories", params) do |response|
18
+ response["relatable_categories"].map{|relatable_category| Calculated::Models::RelatableCategory.new(relatable_category)}
19
+ end
20
+ end
3
21
 
4
22
  # this call just beings back a native array with hash of ids and identifiers
5
23
  # @example
@@ -1,3 +1,3 @@
1
1
  module Calculated
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.1
8
+ - 2
9
+ version: 0.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Richard Hooker
@@ -14,13 +14,13 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-07-21 00:00:00 +01:00
17
+ date: 2010-08-16 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: activesupport
22
- prerelease: false
23
22
  requirement: &id001 !ruby/object:Gem::Requirement
23
+ none: false
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
@@ -31,11 +31,12 @@ dependencies:
31
31
  - beta3
32
32
  version: 3.0.0.beta3
33
33
  type: :runtime
34
+ prerelease: false
34
35
  version_requirements: *id001
35
36
  - !ruby/object:Gem::Dependency
36
37
  name: httparty
37
- prerelease: false
38
38
  requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
39
40
  requirements:
40
41
  - - ">="
41
42
  - !ruby/object:Gem::Version
@@ -45,11 +46,12 @@ dependencies:
45
46
  - 1
46
47
  version: 0.6.1
47
48
  type: :runtime
49
+ prerelease: false
48
50
  version_requirements: *id002
49
51
  - !ruby/object:Gem::Dependency
50
52
  name: hashie
51
- prerelease: false
52
53
  requirement: &id003 !ruby/object:Gem::Requirement
54
+ none: false
53
55
  requirements:
54
56
  - - ">="
55
57
  - !ruby/object:Gem::Version
@@ -59,11 +61,12 @@ dependencies:
59
61
  - 1
60
62
  version: 0.2.1
61
63
  type: :runtime
64
+ prerelease: false
62
65
  version_requirements: *id003
63
66
  - !ruby/object:Gem::Dependency
64
67
  name: moneta
65
- prerelease: false
66
68
  requirement: &id004 !ruby/object:Gem::Requirement
69
+ none: false
67
70
  requirements:
68
71
  - - ">="
69
72
  - !ruby/object:Gem::Version
@@ -73,11 +76,12 @@ dependencies:
73
76
  - 0
74
77
  version: 0.6.0
75
78
  type: :runtime
79
+ prerelease: false
76
80
  version_requirements: *id004
77
81
  - !ruby/object:Gem::Dependency
78
82
  name: tzinfo
79
- prerelease: false
80
83
  requirement: &id005 !ruby/object:Gem::Requirement
84
+ none: false
81
85
  requirements:
82
86
  - - ">="
83
87
  - !ruby/object:Gem::Version
@@ -87,6 +91,7 @@ dependencies:
87
91
  - 22
88
92
  version: 0.3.22
89
93
  type: :runtime
94
+ prerelease: false
90
95
  version_requirements: *id005
91
96
  description: makes using a simple api even more simple;
92
97
  email:
@@ -128,13 +133,16 @@ rdoc_options: []
128
133
  require_paths:
129
134
  - lib
130
135
  required_ruby_version: !ruby/object:Gem::Requirement
136
+ none: false
131
137
  requirements:
132
138
  - - ">="
133
139
  - !ruby/object:Gem::Version
140
+ hash: -5222712809339678
134
141
  segments:
135
142
  - 0
136
143
  version: "0"
137
144
  required_rubygems_version: !ruby/object:Gem::Requirement
145
+ none: false
138
146
  requirements:
139
147
  - - ">="
140
148
  - !ruby/object:Gem::Version
@@ -146,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
154
  requirements: []
147
155
 
148
156
  rubyforge_project: calculated
149
- rubygems_version: 1.3.6
157
+ rubygems_version: 1.3.7
150
158
  signing_key:
151
159
  specification_version: 3
152
160
  summary: A gem to use the carbon calculated api