r4digitalnz 1.0 → 1.0.1

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.
Files changed (4) hide show
  1. data/lib/r4digitalnz.rb +12 -4
  2. data/rakefile +1 -1
  3. data/test/test.rb +1 -1
  4. metadata +2 -2
data/lib/r4digitalnz.rb CHANGED
@@ -9,9 +9,9 @@ module R4DigitalNZ
9
9
  class APIException < StandardError; end
10
10
 
11
11
  class DigitalNZ
12
- def initialize api_key
12
+ def initialize api_key, debug = false
13
13
  @api_key = api_key
14
- @debug = false
14
+ @debug = debug
15
15
  end
16
16
 
17
17
  def search query, options = {}
@@ -116,10 +116,18 @@ module R4DigitalNZ
116
116
 
117
117
  hash['mdWrap']['xmlData'].each do |k,v|
118
118
  (class << self; self;end).class_eval do
119
- define_method(k.to_sym) { v }
119
+ define_method(k.gsub(':', '_').to_sym) { v }
120
120
  end
121
121
  end
122
-
122
+ end
123
+
124
+ def inspect
125
+ out = "#<#R4DigitalNZ::Section:#{self.object_id} "
126
+ public_methods(false).sort.each do |m|
127
+ next if m == "inspect"
128
+ out << ", @#{m}=\"#{send(m.to_sym)}\""
129
+ end
130
+ out << ">"
123
131
  end
124
132
  end
125
133
 
data/rakefile CHANGED
@@ -16,7 +16,7 @@ spec = Gem::Specification.new do |s|
16
16
  s.email = "henry.maddocks@gmail.com"
17
17
  s.homepage = "http://r4digitalnz.rubyforge.org"
18
18
  s.rubyforge_project = "r4digitalnz"
19
- s.version = 1.0
19
+ s.version = "1.0.1"
20
20
  s.files = FileList["lib/r4digitalnz.rb", "copying.txt", "README", "TODO", "rakefile", "test/*.rb"].to_a
21
21
  s.test_files = FileList["test/*.rb"].to_a
22
22
  s.add_dependency('json', '>=1.1.6')
data/test/test.rb CHANGED
@@ -5,7 +5,7 @@ include R4DigitalNZ
5
5
 
6
6
  class Test_DigitalNZ < Test::Unit::TestCase
7
7
  def setup
8
- api_key = "your_api_key"
8
+ api_key = "85be61818d438f9a821a4da98836e8f0"
9
9
  @digitalNZ = DigitalNZ.new api_key
10
10
  end
11
11
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r4digitalnz
3
3
  version: !ruby/object:Gem::Version
4
- version: "1.0"
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henry Maddocks
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-07-06 00:00:00 +12:00
12
+ date: 2009-07-24 00:00:00 +12:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency