authlete 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,135 +1,135 @@
1
- # :nodoc:
2
- #
3
- # Copyright (C) 2015 Authlete, Inc.
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
-
18
- require 'set'
19
-
20
-
21
- module Authlete
22
- module Model
23
- class TaggedValue
24
- # The language tag part. (String)
25
- attr_accessor :tag
26
-
27
- # The value part. (String)
28
- attr_accessor :value
29
-
30
-
31
- private
32
-
33
- # String attributes.
34
- STRING_ATTRIBUTES = ::Set.new([:tag, :value])
35
-
36
- # The constructor
37
- def initialize(hash = new)
38
- # Set default values to string attributes.
39
- STRING_ATTRIBUTES.each do |attr|
40
- send("#{attr}=", nil)
41
- end
42
-
43
- # Set attribute values using the given hash.
44
- authlete_model_taggedValue_update(hash)
45
- end
46
-
47
- def authlete_model_taggedValue_to_key(key)
48
- key = key.to_sym
49
-
50
- # Convert snakecase to camelcase, if necessary.
51
- if SNAKE_TO_CAMEL.has_key?(key)
52
- key = SNAKE_TO_CAMEL[key]
53
- end
54
-
55
- return key
56
- end
57
-
58
- def authlete_model_taggedValue_simple_attribute?(key)
59
- STRING_ATTRIBUTES.include?(key)
60
- end
61
-
62
- def authlete_model_taggedValue_update(hash)
63
- if hash.nil?
64
- return
65
- end
66
-
67
- hash.each do |key, value|
68
- key = authlete_model_taggedValue_to_key(key)
69
-
70
- # If the attribute is a simple one.
71
- if authlete_model_taggedValue_simple_attribute?(key)
72
- send("#{key}=", value)
73
- next
74
- end
75
- end
76
-
77
- return self
78
- end
79
-
80
- public
81
-
82
- # Construct an instance from the given hash.
83
- #
84
- # If the given argument is nil or is not a Hash, nil is returned.
85
- # Otherwise, TaggedValue.new(hash) is returned.
86
- def self.parse(hash)
87
- if hash.nil? or (hash.kind_of?(Hash) == false)
88
- return nil
89
- end
90
-
91
- return Authlete::Model::TaggedValue.new(hash)
92
- end
93
-
94
- # Set attribute values using the given hash.
95
- def update(hash)
96
- authlete_model_taggedValue_update(hash)
97
- end
98
-
99
- # Convert this object into a hash.
100
- def to_hash
101
- hash = {}
102
-
103
- instance_variables.each do |var|
104
- key = var.to_s.delete("@").to_sym
105
- val = instance_variable_get(var)
106
-
107
- hash[key] = val
108
- end
109
-
110
- return hash
111
- end
112
-
113
- def [](key)
114
- key = authlete_model_taggedValue_to_key(key)
115
-
116
- if respond_to?(key)
117
- return send(key)
118
- else
119
- return nil
120
- end
121
- end
122
-
123
- def []=(key, value)
124
- key = authlete_model_taggedValue_to_key(key)
125
- method = "#{key}="
126
-
127
- if respond_to?(method)
128
- return send(method, value)
129
- else
130
- return nil
131
- end
132
- end
133
- end
134
- end
135
- end
1
+ # :nodoc:
2
+ #
3
+ # Copyright (C) 2015 Authlete, Inc.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+
18
+ require 'set'
19
+
20
+
21
+ module Authlete
22
+ module Model
23
+ class TaggedValue
24
+ # The language tag part. (String)
25
+ attr_accessor :tag
26
+
27
+ # The value part. (String)
28
+ attr_accessor :value
29
+
30
+
31
+ private
32
+
33
+ # String attributes.
34
+ STRING_ATTRIBUTES = ::Set.new([:tag, :value])
35
+
36
+ # The constructor
37
+ def initialize(hash = new)
38
+ # Set default values to string attributes.
39
+ STRING_ATTRIBUTES.each do |attr|
40
+ send("#{attr}=", nil)
41
+ end
42
+
43
+ # Set attribute values using the given hash.
44
+ authlete_model_taggedValue_update(hash)
45
+ end
46
+
47
+ def authlete_model_taggedValue_to_key(key)
48
+ key = key.to_sym
49
+
50
+ # Convert snakecase to camelcase, if necessary.
51
+ if SNAKE_TO_CAMEL.has_key?(key)
52
+ key = SNAKE_TO_CAMEL[key]
53
+ end
54
+
55
+ return key
56
+ end
57
+
58
+ def authlete_model_taggedValue_simple_attribute?(key)
59
+ STRING_ATTRIBUTES.include?(key)
60
+ end
61
+
62
+ def authlete_model_taggedValue_update(hash)
63
+ if hash.nil?
64
+ return
65
+ end
66
+
67
+ hash.each do |key, value|
68
+ key = authlete_model_taggedValue_to_key(key)
69
+
70
+ # If the attribute is a simple one.
71
+ if authlete_model_taggedValue_simple_attribute?(key)
72
+ send("#{key}=", value)
73
+ next
74
+ end
75
+ end
76
+
77
+ return self
78
+ end
79
+
80
+ public
81
+
82
+ # Construct an instance from the given hash.
83
+ #
84
+ # If the given argument is nil or is not a Hash, nil is returned.
85
+ # Otherwise, TaggedValue.new(hash) is returned.
86
+ def self.parse(hash)
87
+ if hash.nil? or (hash.kind_of?(Hash) == false)
88
+ return nil
89
+ end
90
+
91
+ return Authlete::Model::TaggedValue.new(hash)
92
+ end
93
+
94
+ # Set attribute values using the given hash.
95
+ def update(hash)
96
+ authlete_model_taggedValue_update(hash)
97
+ end
98
+
99
+ # Convert this object into a hash.
100
+ def to_hash
101
+ hash = {}
102
+
103
+ instance_variables.each do |var|
104
+ key = var.to_s.delete("@").to_sym
105
+ val = instance_variable_get(var)
106
+
107
+ hash[key] = val
108
+ end
109
+
110
+ return hash
111
+ end
112
+
113
+ def [](key)
114
+ key = authlete_model_taggedValue_to_key(key)
115
+
116
+ if respond_to?(key)
117
+ return send(key)
118
+ else
119
+ return nil
120
+ end
121
+ end
122
+
123
+ def []=(key, value)
124
+ key = authlete_model_taggedValue_to_key(key)
125
+ method = "#{key}="
126
+
127
+ if respond_to?(method)
128
+ return send(method, value)
129
+ else
130
+ return nil
131
+ end
132
+ end
133
+ end
134
+ end
135
+ end
@@ -23,7 +23,7 @@ module Authlete
23
23
  # == Authlete::Request::DeveloperAuthenticationCallbackRequest class
24
24
  #
25
25
  # This class represents a request to a developer authentication callback endpoint.
26
- class AuthenticationCallbackRequest
26
+ class DeveloperAuthenticationCallbackRequest
27
27
  include Authlete::Utility
28
28
 
29
29
  # The API key of the service.
@@ -1,3 +1,3 @@
1
1
  module Authlete
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authlete
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takahiko Kawasaki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-24 00:00:00.000000000 Z
11
+ date: 2015-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.7.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.7.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.7'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.7'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '10.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '10.0'
55
55
  description: A library for Authlete Web APIs. See https://www.authlete.com/authlete_web_apis.html
@@ -60,7 +60,7 @@ executables: []
60
60
  extensions: []
61
61
  extra_rdoc_files: []
62
62
  files:
63
- - .gitignore
63
+ - ".gitignore"
64
64
  - Gemfile
65
65
  - LICENSE.txt
66
66
  - README.md
@@ -96,17 +96,17 @@ require_paths:
96
96
  - lib
97
97
  required_ruby_version: !ruby/object:Gem::Requirement
98
98
  requirements:
99
- - - ! '>='
99
+ - - ">="
100
100
  - !ruby/object:Gem::Version
101
101
  version: '0'
102
102
  required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  requirements:
104
- - - ! '>='
104
+ - - ">="
105
105
  - !ruby/object:Gem::Version
106
106
  version: '0'
107
107
  requirements: []
108
108
  rubyforge_project:
109
- rubygems_version: 2.3.0
109
+ rubygems_version: 2.4.6
110
110
  signing_key:
111
111
  specification_version: 4
112
112
  summary: A library for Authlete Web APIs