Class: Ottogen::Config::Data

Inherits:
Object
  • Object
show all
Defined in:
lib/ottogen/config.rb

Instance Method Summary collapse

Constructor Details

#initialize(files) ⇒ Data

Returns a new instance of Data.



107
108
109
# File 'lib/ottogen/config.rb', line 107

def initialize(files)
  @files = files
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



119
120
121
122
123
# File 'lib/ottogen/config.rb', line 119

def method_missing(name, *args)
  return @files[name.to_s] if @files.key?(name.to_s)

  super
end

Instance Method Details

#[](key) ⇒ Object



111
112
113
# File 'lib/ottogen/config.rb', line 111

def [](key)
  @files[key.to_s]
end

#respond_to_missing?(name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


115
116
117
# File 'lib/ottogen/config.rb', line 115

def respond_to_missing?(name, include_private = false)
  @files.key?(name.to_s) || super
end