Commit 5abfc7fa authored by Grzegorz Bizon's avatar Grzegorz Bizon

Define ci entry accessor instead of method_missing

parent 12080ba1
...@@ -55,6 +55,12 @@ module Gitlab ...@@ -55,6 +55,12 @@ module Gitlab
{ class: entry_class, { class: entry_class,
description: metadata[:description] } } description: metadata[:description] } }
define_method(symbol) do
raise Entry::InvalidError unless valid?
@nodes[symbol].try(:value)
end
(@allowed_nodes ||= {}).merge!(node) (@allowed_nodes ||= {}).merge!(node)
end end
end end
......
...@@ -52,13 +52,6 @@ module Gitlab ...@@ -52,13 +52,6 @@ module Gitlab
{} {}
end end
def method_missing(name, *args)
super unless allowed_nodes.has_key?(name)
raise InvalidError unless valid?
@nodes[name].try(:value)
end
def add_node(key, entry) def add_node(key, entry)
raise NotImplementedError raise NotImplementedError
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment