I was digging some kind of ruby code and I came across them and not sure what they mean
def success?
!!@success
end
def failure?
!@success
end
cattr_accessor :test_response
and finally this piece of code
class_inheritable_accessor :attributes
self.attributes = []
def self.attribute(name, options={})
top_level_name = name.to_s.split(".").last.underscore
define_method top_level_name do
read_attribute name
end
If you know only one or two, that’s good ... I just want to understand them ... thanks
source
share