Class: Joey::Action
Instance Attribute Summary
Attributes inherited from Model
Instance Method Summary collapse
Methods inherited from Model
define_properties, find, has_association, hash_populating_accessor, #initialize, recognize?
Constructor Details
This class inherits a constructor from Joey::Model
Instance Method Details
#valid? ⇒ Boolean
10 11 12 13 |
# File 'lib/joey/action.rb', line 10 def valid? self.validate self.errors.empty? end |
#validate ⇒ Object
5 6 7 8 |
# File 'lib/joey/action.rb', line 5 def validate errors << { :message => "name should String but is #{name.inspect}" } unless name.is_a?(String) errors << { :message => "link should String but is #{link.inspect}" } unless link.is_a?(String) end |