Class: Frizz::Environment
- Inherits:
-
Object
- Object
- Frizz::Environment
- Defined in:
- lib/frizz/environment.rb
Instance Attribute Summary collapse
-
#bucket ⇒ Object
readonly
Returns the value of attribute bucket.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, data) ⇒ Environment
constructor
A new instance of Environment.
-
#method_missing(meth, *args, &block) ⇒ Object
Don’t raise on undefined methods.
Constructor Details
#initialize(name, data) ⇒ Environment
Returns a new instance of Environment.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/frizz/environment.rb', line 5 def initialize(name, data) @name = name data.each do |attribute, value| ivar_name = "@#{attribute}" instance_variable_set(ivar_name, value) self.class.send :define_method, attribute do instance_variable_get(ivar_name) end end @bucket ||= @host end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args, &block) ⇒ Object
Don’t raise on undefined methods. Allows for flexible use of frizz.yml attributes.
22 |
# File 'lib/frizz/environment.rb', line 22 def method_missing(meth, *args, &block); end |
Instance Attribute Details
#bucket ⇒ Object (readonly)
Returns the value of attribute bucket.
3 4 5 |
# File 'lib/frizz/environment.rb', line 3 def bucket @bucket end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/frizz/environment.rb', line 3 def name @name end |