Skip to content

Commit fb2f22c

Browse files
committed
organisation
1 parent d841129 commit fb2f22c

File tree

4 files changed

+36
-8
lines changed

4 files changed

+36
-8
lines changed

lib/iqeo-conf.rb

-7
This file was deleted.

lib/iqeo/configuration.rb

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
module Iqeo
2+
3+
module Conf
4+
5+
class Configuration
6+
7+
# todo: tests - init without block, with block & param, with plain block
8+
9+
def initialize &block
10+
@items = {}
11+
if block_given?
12+
if block.arity == 1
13+
yield self
14+
else
15+
instance_eval &block
16+
end
17+
end
18+
end
19+
20+
# todo: tests - with value, without value, multiple values ?, optional '=' with value ?
21+
22+
def method_missing name, *value
23+
if value.empty?
24+
@items[name]
25+
else
26+
@items[name] = value.first
27+
end
28+
end
29+
30+
end
31+
32+
end
33+
34+
end
35+
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Iqeo
2-
module Conf
2+
class Configuration
33
VERSION = "0.0.1"
44
end
55
end

scratch.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)