Class: Raph::Raph
- Inherits:
-
Object
show all
- Defined in:
- lib/raph.rb
Overview
Instance Method Summary
collapse
Constructor Details
#initialize ⇒ Raph
Returns a new instance of Raph.
8
9
10
11
|
# File 'lib/raph.rb', line 8
def initialize
@parsed = {}
@parsers = []
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_sym, *arguments, &block) ⇒ Object
29
30
31
32
33
34
35
36
|
# File 'lib/raph.rb', line 29
def method_missing(method_sym, *arguments, &block)
if has_attribute? method_sym
get_attribute_value method_sym
else
super
end
end
|
Instance Method Details
#add_parser(parser) ⇒ Object
25
26
27
|
# File 'lib/raph.rb', line 25
def add_parser(parser)
@parsers.push parser
end
|
#all ⇒ Object
21
22
23
|
# File 'lib/raph.rb', line 21
def all
@all.dup
end
|
#parse(args) ⇒ Object
13
14
15
16
17
18
19
|
# File 'lib/raph.rb', line 13
def parse(args)
@all = args.dup
@parsers.each do |p|
@parsed[p.id.to_sym] = p.parse(@all)
end
end
|