girlscout 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/girlscout.rb +1 -0
- data/lib/girlscout/conversation.rb +1 -1
- data/lib/girlscout/resource.rb +1 -1
- data/lib/girlscout/search.rb +15 -0
- data/lib/girlscout/thread.rb +6 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1db9fef9c041a2c4a3964613d2a90fe107af20a
|
4
|
+
data.tar.gz: c403edcb316e05b97291a5ec307ff779128dc1d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1abb94c3622a62932338675a1ac98768610cd4e2755652cb68988280d6600065971f448f2e91d27b2bbb96457109e22f5a347226d752b2f50d71b0a182a096f6
|
7
|
+
data.tar.gz: 929ca13c7367819b2e6105f4de1cbd01882ddb569c676cdbccc89544ca847daffeadf40dd219e10507c567c346dbee9914ab1f9fbff6cb77afb477b162918dcd
|
data/lib/girlscout.rb
CHANGED
@@ -8,7 +8,7 @@ module GirlScout
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def create(attributes)
|
11
|
-
attributes = attributes.as_json if attributes.
|
11
|
+
attributes = attributes.as_json if attributes.respond_to?(:as_json)
|
12
12
|
attributes["reload"] ||= true
|
13
13
|
Conversation.new(resource.post(attributes)["item"])
|
14
14
|
end
|
data/lib/girlscout/resource.rb
CHANGED
@@ -9,7 +9,7 @@ module GirlScout
|
|
9
9
|
|
10
10
|
def rest_resource
|
11
11
|
return @rest_resource if @rest_resource
|
12
|
-
return @rest_resource = @options[:
|
12
|
+
return @rest_resource = @options[:rest_resource] if @options[:rest_resource]
|
13
13
|
|
14
14
|
resource_class = @options[:resource_class] || RestClient::Resource
|
15
15
|
@rest_resource = resource_class.new("#{@url}.json", @options)
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module GirlScout
|
2
|
+
class Search < GirlScout::Object
|
3
|
+
endpoint '/search'
|
4
|
+
|
5
|
+
class << self
|
6
|
+
def conversations(query)
|
7
|
+
List.new(resource['/conversations'].get(query: query), Conversation)
|
8
|
+
end
|
9
|
+
|
10
|
+
def customers(query)
|
11
|
+
List.new(resource['/customers'].get(query: query), Customer)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/girlscout/thread.rb
CHANGED
@@ -11,5 +11,11 @@ module GirlScout
|
|
11
11
|
creator_type = attr["type"].capitalize.constantize rescue User
|
12
12
|
@created_by ||= creator_type.new(attr)
|
13
13
|
end
|
14
|
+
|
15
|
+
def as_json
|
16
|
+
json = super
|
17
|
+
json["createdBy"] = created_by.as_json if key?("created_by")
|
18
|
+
json
|
19
|
+
end
|
14
20
|
end
|
15
21
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: girlscout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chakrit Wichian
|
@@ -126,6 +126,7 @@ files:
|
|
126
126
|
- lib/girlscout/mailbox.rb
|
127
127
|
- lib/girlscout/object.rb
|
128
128
|
- lib/girlscout/resource.rb
|
129
|
+
- lib/girlscout/search.rb
|
129
130
|
- lib/girlscout/thread.rb
|
130
131
|
- lib/girlscout/user.rb
|
131
132
|
homepage: https://www.omise.co
|