A set of guards for good behavior:
checks that fields given to read_attribute, write_attribute, etc are defined
# File lib/gorillib/model/lint.rb, line 12 def attribute_set?(field_name, *) check_field(field_name) ; super ; end
# File lib/gorillib/model/lint.rb, line 9 def read_attribute(field_name, *) check_field(field_name) ; super ; end
@return [true] if the field exists @raise [UnknownFieldError] if the field is missing
# File lib/gorillib/model/lint.rb, line 17 def check_field(field_name) return true if self.class.has_field?(field_name) raise UnknownFieldError, "unknown field: #{field_name} for #{self}" end
Generated with the Darkfish Rdoc Generator 2.