construct 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/construct.rb +10 -1
  2. metadata +2 -2
data/lib/construct.rb CHANGED
@@ -3,7 +3,7 @@ class Construct
3
3
  # Ruby and humans with text editors.
4
4
 
5
5
  APP_NAME = 'Construct'
6
- APP_VERSION = '0.1.4'
6
+ APP_VERSION = '0.1.5'
7
7
  APP_AUTHOR = 'Kyle Kingsbury'
8
8
  APP_EMAIL = 'aphyr@aphyr.com'
9
9
  APP_URL = 'http://aphyr.com'
@@ -11,6 +11,8 @@ class Construct
11
11
 
12
12
  require 'yaml'
13
13
 
14
+ include Enumerable
15
+
14
16
  class << self
15
17
  attr_writer :schema
16
18
  end
@@ -101,6 +103,13 @@ class Construct
101
103
  @data.delete key
102
104
  end
103
105
 
106
+ # Like enumerable#each. Operates on each key.
107
+ def each
108
+ keys.each do |key|
109
+ yield key, self[key]
110
+ end
111
+ end
112
+
104
113
  # Returns true if the construct has a value set for, or the schema defines,
105
114
  # the key.
106
115
  def include?(*args)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: construct
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Kingsbury
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-11 00:00:00 -08:00
12
+ date: 2009-11-16 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies: []
15
15