frizzle 0.0.1 → 0.0.2

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: 5c7035aef1e6d6cfd06387fd23c123cd89cb8fa1
4
- data.tar.gz: e4bb1013ea4dc5e8abcb1a0b7fff2460326e4746
3
+ metadata.gz: 71bc610a691f498af1e64c506af3e9feb243a57a
4
+ data.tar.gz: b7288a68dac615ec55f7b00b5b156adc1cf649df
5
5
  SHA512:
6
- metadata.gz: 35467cf9d3843705c3daecf22e006a5c004d0db1e659d7ac36a2c93ec31e1a1166409e408136a530094c1555a1e852c3b3066e171b89c02b1febf6758ba986c9
7
- data.tar.gz: 75b45a6e7737b4afeef4c19c22f0759fc40eaca1ee68ae000743b9e23463e1aac2b73d85689c559577ebef8f36f84d441760a59a05288f4582b5e5e0abe01586
6
+ metadata.gz: 5bb87668fbc62c30b59c3e5742276933dba444b790dcbb9abe487ed12aea3e3a96d102e3a6656b5bc786e745e0a9c61583061d5f8323aef7b01d2bf610f453d4
7
+ data.tar.gz: eb362163b28ec7ef909eaec05a5a480a363b3082fd5b5fa417fd503adc73f7d2c01fc158338b018236649a0ed42e5cfa5cf10ea69f24dcafebfb17b593f6fd79
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Frizzle: A Ruby wrapper for the TransLoc API
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/frizzle.png)](http://badge.fury.io/rb/frizzle)
4
+
3
5
  Frizzle is a Ruby wrapper for the [TransLoc Public API](http://api.transloc.com/doc/).
4
6
 
5
7
  Supports all the TransLoc v1.2 API methods. You can either use the whole API wrapper through `Frizzle` or use parts of it i.e. `Frizzle::Agencies.all` if you solely want to work with a particular resource.
@@ -11,13 +13,13 @@ For more information on the TransLoc API, visit [http://api.transloc.com/doc/](h
11
13
  Add this line to your application's Gemfile:
12
14
 
13
15
  ```ruby
14
- gem 'frizzle', :git => "git://github.com/tylerpearson/frizzle.git"
16
+ gem 'frizzle'
15
17
  ```
16
18
 
17
19
  Or install it yourself as:
18
20
 
19
21
  ```ruby
20
- gem install "frizzle", :git => "git://github.com/tylerpearson/frizzle.git"
22
+ gem install "frizzle"
21
23
  ```
22
24
 
23
25
  ## Usage
@@ -36,6 +38,8 @@ Frizzle::Agencies.all
36
38
 
37
39
  The TransLoc API does not require an API key.
38
40
 
41
+ #### Geographical Filtering
42
+
39
43
  For methods that allow limiting the results with a geographical area filter, there are two form options: *rectangle form* and *point and radius form*.
40
44
 
41
45
  To limit with *rectangle form*, pass two arrays ([lat, lng]) for the two geo area arguments. It would look like:
@@ -54,7 +58,8 @@ Frizzle.agencies.find_by_geo_area([35.80176,-78.64347], 70)
54
58
 
55
59
  Agencies can be accessed through `Frizzle.agencies` or `Frizzle::Agencies`. This API call can be requested every 10 seconds from the same IP address.
56
60
 
57
- *Examples:*
61
+ ##### Examples:
62
+
58
63
  ```ruby
59
64
  Frizzle::Agencies.all
60
65
  Frizzle.agencies.all
@@ -67,11 +72,12 @@ Frizzle.agencies.find_by_id_and_geo_area("168", [35.80176,-78.64347], 120)
67
72
  Frizzle.agencies.find({:agencies => "12", :geo_area => "35.80176,-78.64347|100"})
68
73
  ```
69
74
 
70
- ### Segments
75
+ ### Segments
71
76
 
72
77
  Segments can be accessed through `Frizzle.segments` or `Frizzle::Segments`. This API call can be requested every 10 seconds from the same IP address.
73
78
 
74
- *Examples:*
79
+ ##### Examples:
80
+
75
81
  ```ruby
76
82
  Frizzle::Segments.find_by_agencies(24)
77
83
  Frizzle.segments.find_by_agencies(24)
@@ -87,7 +93,8 @@ Frizzle.segments.find({:agencies => "24"}
87
93
 
88
94
  Routes can be accessed through `Frizzle.routes` or `Frizzle::Routes`. This API call can be requested every 10 seconds from the same IP address.
89
95
 
90
- *Examples:*
96
+ ###### Examples:
97
+
91
98
  ```ruby
92
99
  Frizzle::Routes.find_by_agencies("24")
93
100
  Frizzle.routes.find_by_agencies("24")
@@ -100,7 +107,7 @@ Frizzle::Routes.find({:agencies => "24"})
100
107
 
101
108
  Stops can be accessed through `Frizzle.stops` or `Frizzle::Stops`. This API call can be requested every 10 seconds from the same IP address.
102
109
 
103
- *Examples:*
110
+ ###### Examples:
104
111
 
105
112
  ```ruby
106
113
  Frizzle::Stops.find_by_agencies(24)
@@ -113,7 +120,8 @@ Frizzle::Stops.find({:agencies => "24"})
113
120
 
114
121
  Vehicles can be accessed through `Frizzle.vehicles` or `Frizzle::Vehicles`. This API call can be requested every 1 second from the same IP address.
115
122
 
116
- *Examples:*
123
+ ###### Examples:
124
+
117
125
  ```ruby
118
126
  Frizzle::Vehicles.find_by_agencies("24")
119
127
  Frizzle.vehicles.find_by_agencies("24")
@@ -126,7 +134,8 @@ Frizzle::Vehicles.find({:agencies => "24"})
126
134
 
127
135
  Arrival estimates can be accessed through `Frizzle.arrival_estimates` or `Frizzle::ArrivalEstimates`. This API call can be requested every 1 second from the same IP address.
128
136
 
129
- *Examples:*
137
+ ###### Examples:
138
+
130
139
  ```ruby
131
140
  Frizzle::ArrivalEstimates.find_by_agencies("24")
132
141
  Frizzle.arrival_estimates.find_by_agencies("24")
@@ -6,13 +6,11 @@ module Frizzle
6
6
  :query => options )
7
7
  end
8
8
 
9
- # 168,275
10
9
  def self.find_by_agencies(agencies)
11
10
  fetch("/routes.json",
12
11
  :query => { :agencies => formatted_list(agencies) })
13
12
  end
14
13
 
15
- # 168 35.80176,-78.64347|75.5
16
14
  def self.find_by_agencies_and_geo_area(agencies, geo_area_first, geo_area_second=Frizzle::Base::DEFAULT_GEO_RADIUS)
17
15
  fetch("/routes.json",
18
16
  :query => {
@@ -19,7 +19,6 @@ module Frizzle
19
19
  })
20
20
  end
21
21
 
22
- # 168 35.80176,-78.64347|75.5
23
22
  def self.find_by_agencies_and_geo_area(agencies, geo_area_first, geo_area_second=Frizzle::Base::DEFAULT_GEO_RADIUS)
24
23
  fetch("/segments.json",
25
24
  :query => {
@@ -6,7 +6,6 @@ module Frizzle
6
6
  :query => options )
7
7
  end
8
8
 
9
- # 168,275
10
9
  def self.find_by_agencies(agencies)
11
10
  fetch("/vehicles.json",
12
11
  :query => { :agencies => formatted_list(agencies) })
@@ -1,3 +1,3 @@
1
1
  module Frizzle
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frizzle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Pearson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-01 00:00:00.000000000 Z
11
+ date: 2013-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler