lazy_records 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: fd7a68f028ff135994cc7a26a6c2227ed5b6391c
4
- data.tar.gz: c4e178058ce9ad3e57869c44b045dc94192338b1
3
+ metadata.gz: bba4f06a5f8bdd6d839aabec226227e05298d2d9
4
+ data.tar.gz: bcda4b9cce83208438b15c247e9f0459073a9025
5
5
  SHA512:
6
- metadata.gz: d41d97f08b04d743b80b8184f8c9fddd79a994b78e0487581a21ffbd8067e767fcd87382975d5d8e91a177e587bd32e0b890a25d1ba36efbc19ed26fe8d966b0
7
- data.tar.gz: 417241c64d24a1fda08d8ff4e53b1861895523349bc1c060a4181fdd287ab02ad56857785fe45859fd1aa314f8896a5b56467cae50c6b4fc33c5b53e02aea175
6
+ metadata.gz: 6132d887f2f00af3e17eb42c20b8e8f6412ca9a53ae54b3cf2a0393f327d85d550cfef07f68f4d3e8e612880db9da4c002d00f5faa08e0ab87ab61eed7e75d18
7
+ data.tar.gz: a770beffa97717f64aff5cb9de9bcc597012fdd2a160e22822f68ce914f3702b6d9f19b3d5469bbf117b71bde6e5389a0c69ab3d1fb9cfbb824ce6ebf9c1520a
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: lazy_records 0.0.3 ruby lib
5
+ # stub: lazy_records 0.0.4 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "lazy_records"
9
- s.version = "0.0.3"
9
+ s.version = "0.0.4"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
@@ -4,6 +4,7 @@ class Sqlite3
4
4
 
5
5
  def initialize(database,show_sql=false)
6
6
  @client = SQLite3::Database.new(database)
7
+ @client.results_as_hash=true
7
8
  @show_sql = show_sql
8
9
  end
9
10
 
@@ -10,6 +10,17 @@ module LazyRecords
10
10
 
11
11
  class Record < OpenStruct
12
12
 
13
+ def initialize(hash=nil)
14
+ @table = {}
15
+ if hash
16
+ hash.each_pair do |k, v|
17
+ k = k.to_s.to_sym
18
+ @table[k] = v
19
+ new_ostruct_member(k)
20
+ end
21
+ end
22
+ end
23
+
13
24
  def get_hash
14
25
  self.instance_variable_get("@table")
15
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lazy_records
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
  - Kingsley Hendrickse