Method: Part.listify
- Defined in:
- lib/oro/parts.rb
.listify ⇒ Object
instance_exec (vs. instance_eval) to pass params, define_singleton_method to add the class method
15 16 17 18 19 |
# File 'lib/oro/parts.rb', line 15 def self.listify list = YAML.load_file(@list_location) instance_exec(list) { |l| define_singleton_method('list') { @list ||= l } } self.respond_to?(:list) ? true : false end |