inflect 0.3.2 → 0.3.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a65aba01e8a039d61e5124ba29115d629985b60c
4
- data.tar.gz: 137cb2f57613ec2f063010e970a99714aba90a10
3
+ metadata.gz: ef4ebd82aeec1ab6cbee6f7ded7c99b1408128bd
4
+ data.tar.gz: 4d37bf7179f3914425fa2163d8db7ef2d0e48729
5
5
  SHA512:
6
- metadata.gz: 7b6c75ee47b72481eac910cb5d350928e3e23a3d8a4236dbc9ba522fd9e86ca0298d7463764972246c55e8b1596729ee38ed9e12504fe16d20b232a05275b108
7
- data.tar.gz: a5fff1a274959e471e94d11126b8b81ced0484caa9ddd645bcbce051371c319a2e9f8381e9a123192917e02a919c306eddf0bb06cd94d824d1c9dfe31013d8e4
6
+ metadata.gz: 795a6154df6cadf12edbc30c5137087fbc556c9bbbf5a7cf45e05ea64b79f50f2bd32e09e744a7df463a993a01db7952f4ede375db62ef9a3e6d12166a5f85c4
7
+ data.tar.gz: 785036b7e231c324d0cddcc82c2c244209ca61b0ac473eaf954b4d9b390883c5ae61abacc625530ca318b186fad93a20d26ea3014881919d06935b08622ea72b
@@ -14,16 +14,16 @@ module Inflect
14
14
  attr_reader :errors
15
15
 
16
16
  # @param content [String, Hash] The response of the service. Required.
17
- # @param description [Hash] Contains all the description of service response.
18
- # @option description [Class] :served_by Handler Service. Instance of AbstractService. Required.
19
- # @option description [Array<String>] :query_words The list of words received on the request. Required.
20
- # @option description [String] :handled_word The handled word by the service. Required.
17
+ # @param attributes [Hash] Contains all the attributes of service response.
18
+ # @option attributes [Class] :served_by Handler Service. Instance of AbstractService. Required.
19
+ # @option attributes [Array<String>] :query_words The list of words received on the request. Required.
20
+ # @option attributes [String] :handled_word The handled word by the service. Required.
21
21
  # @return [Inflect::Response]
22
- def initialize(content=nil, description={})
22
+ def initialize(content=nil, attributes={})
23
23
  @content = content
24
24
  @timestamp = Time.now
25
25
  @errors = {}
26
- @attributes = extract_attributes(description)
26
+ @attributes = attributes
27
27
  end
28
28
 
29
29
  # Keys of the required attributes.
@@ -59,14 +59,5 @@ module Inflect
59
59
  end
60
60
  true
61
61
  end
62
-
63
- def extract_attributes(description={})
64
- attributes = {}
65
-
66
- self.class.attribute_keys.each do |key|
67
- attributes.store key, description[key]
68
- end
69
- attributes
70
- end
71
62
  end
72
63
  end
@@ -9,7 +9,7 @@ module Inflect
9
9
  def serve(words)
10
10
  content, options = handle(words)
11
11
  opts = merge_options(options, { query_words: words })
12
- validate_response(Inflect::Response.new(content, opts))
12
+ response = validate_response(Inflect::Response.new(content, opts))
13
13
  end
14
14
 
15
15
  # Supply more expressiveness and flexibility to the interface
@@ -20,7 +20,7 @@ module Inflect
20
20
  # respond 'String Response', opt: 'Extra options'
21
21
  # @example Or as a Hash with options
22
22
  # respond({content: 'Hashed Response'}, {opt: 'Extra options'})
23
- def respond(content, options= {})
23
+ def respond(content, options = {})
24
24
  [content, options]
25
25
  end
26
26
 
@@ -1,3 +1,3 @@
1
1
  module Inflect
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inflect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Santiago Figueiras
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-04-02 00:00:00.000000000 Z
12
+ date: 2016-07-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -134,9 +134,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  version: '0'
135
135
  requirements: []
136
136
  rubyforge_project:
137
- rubygems_version: 2.4.8
137
+ rubygems_version: 2.5.1
138
138
  signing_key:
139
139
  specification_version: 4
140
140
  summary: Backend service API support for the inflect-client app.
141
141
  test_files: []
142
- has_rdoc: