Method: Talk::Context.add_property_allowed
- Defined in:
- lib/context_class.rb
.add_property_allowed(name, allowed) ⇒ Object
163 164 165 166 167 168 169 |
# File 'lib/context_class.rb', line 163 def add_property_allowed(name, allowed) ref = "#{@classname}.#{name}" norm_allow = normalize_allowed(name, allowed).join(", ") errmsg = "#{ref}: must be one of #{norm_allow}" validate( errmsg, name, lambda { |c,v| norm_allow.include? v } ) end |