vast_api 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
data/lib/vast_api.rb CHANGED
@@ -15,7 +15,7 @@ require File.expand_path('../vast_api/listings/entry.rb', __FILE__)
15
15
 
16
16
  class VastApi
17
17
  attr_accessor :api_url
18
-
18
+
19
19
  def initialize(apikey=nil, cat=nil)
20
20
  @api_url = 'http://data.vast.com/'
21
21
  @category = cat
@@ -32,11 +32,10 @@ class VastApi
32
32
  end
33
33
 
34
34
  def category(cat=nil)
35
- self.dup
36
35
  if cat.nil?
37
36
  @category
38
37
  else
39
- self.dup.category!(cat)
38
+ self.clone.category!(cat)
40
39
  end
41
40
  end
42
41
 
@@ -46,7 +45,7 @@ class VastApi
46
45
  end
47
46
 
48
47
  def where(options)
49
- self.dup.where!(options)
48
+ self.clone.where!(options)
50
49
  end
51
50
 
52
51
  def api_key
@@ -90,7 +89,7 @@ class VastApi
90
89
 
91
90
  def find!(id)
92
91
  raise ArgumentError, "No id was entered" if id.nil? || id.empty?
93
- find(id)
92
+ find(id)
94
93
  end
95
94
 
96
95
  def self.find(id, cat)
@@ -1,7 +1,7 @@
1
1
  class VastApi
2
2
  class Attributes < Hash
3
3
  attr_reader :xml, :url, :vast
4
-
4
+ delegate :attributes, :listings, :categories, :to=>@vast
5
5
  def initialize(vast)
6
6
  @vast = vast
7
7
  @url = "#{@vast.api_url}attributes/-/#{@vast.category}?#{@vast.query}"
@@ -21,17 +21,6 @@ class VastApi
21
21
  end
22
22
  end
23
23
 
24
- def attributes
25
- @vast.attributes
26
- end
27
-
28
- def listings
29
- @vast.listings
30
- end
31
-
32
- def categories
33
- @vast.categories
34
- end
35
24
  private
36
25
 
37
26
  def populate
@@ -2,6 +2,8 @@ class VastApi
2
2
  class Categories < Hash
3
3
  attr_reader :xml, :url, :vast
4
4
 
5
+ delegate :attributes, :listings, :categories, :to=>@vast
6
+
5
7
  def initialize(vast)
6
8
  @vast = vast
7
9
  @url = "#{@vast.api_url}categories?#{@vast.api_query}"
@@ -21,18 +23,6 @@ class VastApi
21
23
  end
22
24
  end
23
25
 
24
- def attributes
25
- @vast.attributes
26
- end
27
-
28
- def listings
29
- @vast.listings
30
- end
31
-
32
- def categories
33
- @vast.categories
34
- end
35
-
36
26
  private
37
27
 
38
28
  def populate
@@ -2,6 +2,8 @@ class VastApi
2
2
  class Listings < Array
3
3
  attr_reader :xml, :url, :vast
4
4
 
5
+ delegate :attributes, :listings, :categories, :to=>@vast
6
+
5
7
  def initialize(vast)
6
8
  @vast = vast
7
9
  @url = "#{@vast.api_url}listings/-/#{@vast.category}?#{@vast.query}"
@@ -21,18 +23,6 @@ class VastApi
21
23
  end
22
24
  end
23
25
 
24
- def attributes
25
- @vast.attributes
26
- end
27
-
28
- def listings
29
- @vast.listings
30
- end
31
-
32
- def categories
33
- @vast.categories
34
- end
35
-
36
26
  def query
37
27
  if @query.nil?
38
28
  @query = {}
data/vast_api.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{vast_api}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Ryan Ong", "Mikhail Knyazev"]
12
- s.date = %q{2011-03-28}
11
+ s.authors = [%q{Ryan Ong}, %q{Mikhail Knyazev}]
12
+ s.date = %q{2011-06-30}
13
13
  s.description = %q{A ruby wrapper for the http://www.vast.com/ api}
14
14
  s.email = %q{ryanong@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -19,7 +19,6 @@ Gem::Specification.new do |s|
19
19
  s.files = [
20
20
  ".document",
21
21
  "Gemfile",
22
- "Gemfile.lock",
23
22
  "LICENSE.txt",
24
23
  "README.rdoc",
25
24
  "Rakefile",
@@ -40,9 +39,9 @@ Gem::Specification.new do |s|
40
39
  "vast_api.gemspec"
41
40
  ]
42
41
  s.homepage = %q{http://github.com/carzen/vast_api}
43
- s.licenses = ["MIT"]
44
- s.require_paths = ["lib"]
45
- s.rubygems_version = %q{1.6.1}
42
+ s.licenses = [%q{MIT}]
43
+ s.require_paths = [%q{lib}]
44
+ s.rubygems_version = %q{1.8.5}
46
45
  s.summary = %q{A ruby wrapper for the http://www.vast.com/ api}
47
46
  s.test_files = [
48
47
  "test/helper.rb",
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: vast_api
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.0
5
+ version: 0.1.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Ryan Ong
@@ -11,8 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2011-03-28 00:00:00 -04:00
15
- default_executable:
14
+ date: 2011-06-30 00:00:00 Z
16
15
  dependencies:
17
16
  - !ruby/object:Gem::Dependency
18
17
  name: activesupport
@@ -125,7 +124,6 @@ extra_rdoc_files:
125
124
  files:
126
125
  - .document
127
126
  - Gemfile
128
- - Gemfile.lock
129
127
  - LICENSE.txt
130
128
  - README.rdoc
131
129
  - Rakefile
@@ -144,7 +142,6 @@ files:
144
142
  - test/helper.rb
145
143
  - test/test_vast_api.rb
146
144
  - vast_api.gemspec
147
- has_rdoc: true
148
145
  homepage: http://github.com/carzen/vast_api
149
146
  licenses:
150
147
  - MIT
@@ -158,7 +155,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
158
155
  requirements:
159
156
  - - ">="
160
157
  - !ruby/object:Gem::Version
161
- hash: -3668420163538428929
158
+ hash: -2433271560619440749
162
159
  segments:
163
160
  - 0
164
161
  version: "0"
@@ -171,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
171
168
  requirements: []
172
169
 
173
170
  rubyforge_project:
174
- rubygems_version: 1.6.1
171
+ rubygems_version: 1.8.5
175
172
  signing_key:
176
173
  specification_version: 3
177
174
  summary: A ruby wrapper for the http://www.vast.com/ api
data/Gemfile.lock DELETED
@@ -1,34 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- activesupport (3.0.5)
5
- addressable (2.2.4)
6
- crack (0.1.8)
7
- git (1.2.5)
8
- jeweler (1.5.2)
9
- bundler (~> 1.0.0)
10
- git (>= 1.2.5)
11
- rake
12
- minitest (2.0.2)
13
- nokogiri (1.4.4)
14
- rake (0.8.7)
15
- rcov (0.9.9)
16
- vcr (1.7.0)
17
- webmock (1.6.2)
18
- addressable (>= 2.2.2)
19
- crack (>= 0.1.7)
20
- yard (0.6.5)
21
-
22
- PLATFORMS
23
- ruby
24
-
25
- DEPENDENCIES
26
- activesupport (>= 2.3.5)
27
- bundler (~> 1.0.0)
28
- jeweler (~> 1.5.2)
29
- minitest
30
- nokogiri
31
- rcov
32
- vcr
33
- webmock
34
- yard (~> 0.6.0)