Module: EasyApiDoc::Configurable::ClassMethods
- Defined in:
- lib/configurable.rb
Instance Method Summary collapse
- #all ⇒ Object
- #config ⇒ Object
-
#config_path ⇒ Object
Override me.
- #find(name) ⇒ Object
-
#root_node ⇒ Object
protected.
Instance Method Details
#all ⇒ Object
12 13 14 15 16 |
# File 'lib/configurable.rb', line 12 def all root_node.map do |name, opts| new(name, opts) end end |
#config ⇒ Object
23 24 25 |
# File 'lib/configurable.rb', line 23 def config Configuration.load end |
#config_path ⇒ Object
Override me
28 29 30 |
# File 'lib/configurable.rb', line 28 def config_path [self.to_s.split("::").last.downcase] end |
#find(name) ⇒ Object
18 19 20 21 |
# File 'lib/configurable.rb', line 18 def find(name) name, attrs = root_node.find {|key, attrs| key.to_s == name.to_s } new(name, attrs) end |
#root_node ⇒ Object
protected
34 35 36 37 38 39 40 |
# File 'lib/configurable.rb', line 34 def root_node node = self.config config_path.each do |n| node = node[n] end node end |