bamboozled 0.0.3 → 0.0.4

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: ddafc1d234e711cb5b4d541c04aa244e1b3dd77c
4
- data.tar.gz: 7a0e3308d1c4d1e7c9f4a76ace3d4a51c5eb11ae
3
+ metadata.gz: 413da1e61f882da4c661b84e0f2c4931e3a801b9
4
+ data.tar.gz: 653872c670f8bb189795b0331970ad23ab4f48f4
5
5
  SHA512:
6
- metadata.gz: aa12f8cb8b8418f8a3326fb4060c526da85a2321992c0c7daf72d8bbec504b97d70e8db909a6d00e6e8803216615ff047ddc1d949f95929db363d380f76c17ab
7
- data.tar.gz: 68a54ef43b03808b854c268e786e96aaa8b812aafa57b1be7a64d83ea6bfb8d4740bbda62d9558fa8315d2547572cefca4cd38c52410b4b1ac6b96c6b5a389f9
6
+ metadata.gz: 1d9ffe7eaa01a46b34eaff800e3fdf54c1c5f7b41a0c14b4b687ce5670f0c8368a9f18752fdd2eef3b265e12c4a2e26f17b69efb362741dbcdc87633d82a24bb
7
+ data.tar.gz: fec918fcd77a836434326718d8e29a49dfab47abd0c90e3010650f2fd46cd047e095f1152c55e77b2cccfc26abbb0ba34471aef80770a18129ac07191370ac8c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bamboozled (0.0.2)
4
+ bamboozled (0.0.3)
5
5
  httparty
6
6
  json
7
7
 
data/Readme.md CHANGED
@@ -60,6 +60,20 @@ client.time_off.whos_out(Time.now, '2014-12-31')
60
60
  client.report.find(report_number, format = 'JSON', fd = true)
61
61
  ```
62
62
 
63
+ # Metadata
64
+
65
+ ```ruby
66
+ # Get fields
67
+ client.meta.fields
68
+ # Get lists
69
+ client.meta.lists
70
+ # Get tables
71
+ client.meta.tables
72
+ # Get users
73
+ # Note: this is all uses in the system, whereas client.employee.all only gets active employees
74
+ client.meta.users
75
+ ```
76
+
63
77
  ## Todo:
64
78
 
65
79
  1. Write tests!
data/lib/bamboozled.rb CHANGED
@@ -8,7 +8,7 @@ require 'bamboozled/version'
8
8
  require 'bamboozled/errors'
9
9
  require 'bamboozled/base'
10
10
 
11
- %w(base employee report time_off).each {|a| require "bamboozled/api/#{a}"}
11
+ %w(base employee report time_off meta).each {|a| require "bamboozled/api/#{a}"}
12
12
 
13
13
  module Bamboozled
14
14
  class << self
@@ -0,0 +1,14 @@
1
+ module Bamboozled
2
+ module API
3
+ class Meta < Base
4
+
5
+ [:field, :table, :list, :user].each do |action|
6
+ define_method("#{action}s") do
7
+ result = request(:get, "meta/#{action}s")
8
+ result["#{action}s".to_sym][action]
9
+ end
10
+ end
11
+
12
+ end
13
+ end
14
+ end
@@ -14,6 +14,10 @@ module Bamboozled
14
14
  @report ||= Bamboozled::API::Report.new(@subdomain, @api_key)
15
15
  end
16
16
 
17
+ def meta
18
+ @meta ||= Bamboozled::API::Meta.new(@subdomain, @api_key)
19
+ end
20
+
17
21
  def time_off
18
22
  @time_off ||= Bamboozled::API::TimeOff.new(@subdomain, @api_key)
19
23
  end
@@ -1,3 +1,3 @@
1
1
  module Bamboozled
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bamboozled
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Rickert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-28 00:00:00.000000000 Z
11
+ date: 2014-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -55,6 +55,7 @@ files:
55
55
  - lib/bamboozled.rb
56
56
  - lib/bamboozled/api/base.rb
57
57
  - lib/bamboozled/api/employee.rb
58
+ - lib/bamboozled/api/meta.rb
58
59
  - lib/bamboozled/api/report.rb
59
60
  - lib/bamboozled/api/time_off.rb
60
61
  - lib/bamboozled/base.rb