Class: CSD::GlobalOpenStruct

Inherits:
Object
  • Object
show all
Defined in:
lib/csd/global_open_struct.rb

Direct Known Subclasses

Options, Path

Class Method Summary collapse

Class Method Details

.method_missing(meth, *args, &block) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/csd/global_open_struct.rb', line 4

def self.method_missing(meth, *args, &block)
  if meth.to_s.ends_with?('=')
    class_variable_set("@@#{meth.to_s.chop}".to_sym, *args)
  else
    begin
      class_variable_get("@@#{meth}".to_sym)
    rescue NameError => e
      #UI.debug "The option `#{meth}´ was accessed but not available."   # FIXME: This line causes a recursion error :)
      nil
    end
  end
end