cat play with a string. # # *Examples*: # cat = Cat.new # crazy = cat.play_with('long string') # crazy.class # #=> Cat::Crazy # # *Parameters*: # - +play_with+ - Object to play with # *Returns*: # - crazy cat # *Raises*: # - +Cat::LazyError+ if play_with is not a string def play(play_with) if play_with.is_a?(String) Crazy.new else raise LazyError, "I'm too lazy to play with #{play_with.inspect}." end end end
Public: Makes cat play with a string. # # play_with - The String to play with # # Examples # # cat = Cat.new # crazy = cat.play_with('long string') # crazy.class # #=> Cat::Crazy # # Raises a Cat::LazyError if play_with is not a string. # # Returns a Cat::Crazy. def play(play_with) if play_with.is_a?(String) Crazy.new else raise LazyError, "I'm too lazy to play with #{play_with.inspect}." end end end
# # play_with - The String to play with # # Examples # # cat = Cat.new # crazy = cat.play_with('long string') # crazy.class # #=> Cat::Crazy # # Raises a Cat::LazyError if play_with is not a string. # # Returns a Cat::Crazy. def play(play_with) if play_with.is_a?(String) Crazy.new else raise LazyError, "I'm too lazy to play with #{play_with.inspect}." end end end
Makes cat play with a string. # # @example # cat = Cat.new # crazy = cat.play_with('long string') # crazy.class # #=> Cat::Crazy # # @param [String] play_with to play with # @raise [Cat::LazyError] if play_with is not a string # @return [Cat::Crazy] crazy cat def play(play_with) if play_with.is_a?(String) Crazy.new else raise LazyError, "I'm too lazy to play with #{play_with.inspect}." end end end
value of $3 property def attribute(type, method, attr) typed_attributes[type] << [method, attr] define_attribute(type, method, attr) end class Anchor attribute String, :rel_list, :relList end
value of $3 property def attribute(type, method, attr) typed_attributes[type] << [method, attr] define_attribute(type, method, attr) end class Anchor attribute String, :rel_list, :relList end
ok Trying: sum(1, -1) Expecting: 0 ok 1 items had no tests: __main__.sum 1 items passed all tests: 2 tests in __main__ 2 tests in 2 items. 2 passed and 0 failed. Test passed.