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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 87bdfb49c6c05ca46969b823e5273971d1be4afd
4
- data.tar.gz: ad7c6ca48f49d2c1648129c0ab163e47d1f2711c
3
+ metadata.gz: 88064809ea632d7c696d9a51c04541d30e1e0135
4
+ data.tar.gz: ecd52dc035f800ecd7cbf0edb71c294b07e390e5
5
5
  SHA512:
6
- metadata.gz: f2dcd60332cf5d9acec4a8b3a2c190eaed5a9b61bdedd116eb66022ff3500f823637f5d28b95e6f483593fe8475a8513f8d0b769a92be5f304c09e2c0c462545
7
- data.tar.gz: a9e4ebc2272801552da06f202109ce14883ebdb3ebd348b9ed9f8f918e28569b8bb456bd0eb2b9416614b83321d5b7a66c6dc24a71c441daf76fa877de7a89d2
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.
@@ -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
@@ -1,3 +1,3 @@
1
1
  module RubyUfc
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_ufc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kiriakos Velissariou