ruby_ufc 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/lib/ruby_ufc/client.rb +5 -0
- data/lib/ruby_ufc/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88064809ea632d7c696d9a51c04541d30e1e0135
|
4
|
+
data.tar.gz: ecd52dc035f800ecd7cbf0edb71c294b07e390e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 518f84ad1e56d8ce8c4e77a47c4e1c3b2014f2f2417ff3c8cdf8b2045fef3d1f6960eb3226a4a60f044583d0642ba2a1d7aa8cc990d2a6e17892d47f1b1ec3d0
|
7
|
+
data.tar.gz: 11aa527338a2bfca50faa98856d6ac59691d1fe4f8aa5d427cc6ebd852249725edbe9d8871d232e99f7db130a66476a2aca242902c037dec09fb141ccf1af2fc
|
data/README.md
CHANGED
@@ -49,6 +49,14 @@ supported actions are:
|
|
49
49
|
* news
|
50
50
|
* media
|
51
51
|
|
52
|
+
Since UFC API has no documentation, each of the actions above comes with a
|
53
|
+
helper action that returns an Array of Symbols with the attributes for that
|
54
|
+
particular resource. You can use them as follows.
|
55
|
+
|
56
|
+
```ruby
|
57
|
+
client.news_attributes #=> [:article_date, :article_fighter_id, :article_media_id, :author, :created, :external_url, :external_url_text, :featured_news_category, :id, :introduction, :keyword_ids, :last_modified, :published_start_date, :thumbnail, :title, :url_name]
|
58
|
+
```
|
59
|
+
|
52
60
|
## Development
|
53
61
|
|
54
62
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/ruby_ufc/client.rb
CHANGED
@@ -20,6 +20,11 @@ module RubyUfc
|
|
20
20
|
response if args.empty?
|
21
21
|
filter_by_argument(response, args)
|
22
22
|
end
|
23
|
+
|
24
|
+
define_method(allowed_resource + '_attributes') do
|
25
|
+
response = send(allowed_resource.to_sym)
|
26
|
+
response.first.keys.map(&:to_sym).sort
|
27
|
+
end
|
23
28
|
end
|
24
29
|
|
25
30
|
private
|
data/lib/ruby_ufc/version.rb
CHANGED