Class: Fluid::FluidVar
Overview
FluidVars are those accessed via “Fluid.varname”. This subclass contains the code for adding those getters and setters.
Instance Attribute Summary
Attributes inherited from Var
Class Method Summary collapse
-
.build(*args) ⇒ Object
:nodoc:.
Instance Method Summary collapse
Methods inherited from Var
global?, #initialize, #pop_binding, #push_binding
Constructor Details
This class inherits a constructor from Fluid::Var
Class Method Details
.build(*args) ⇒ Object
:nodoc:
104 105 106 |
# File 'lib/fluid.rb', line 104 def FluidVar.build(*args) new(*args) # No subclasses to build specially. end |
Instance Method Details
#assert_acceptable_name ⇒ Object
120 121 122 123 124 125 126 127 128 |
# File 'lib/fluid.rb', line 120 def assert_acceptable_name unless name.to_s =~ /^[a-z_]\w*$/ raise NameError, "'#{original_name}' is not a good fluid variable name. It can't be used as a method name." end if Fluid.methods.include?(name.to_s) raise NameError, "'#{original_name}' cannot be a fluid variable. It's already a method of Fluid's." end end |