lib/twitter/base.rb in twitter-5.17.0 vs lib/twitter/base.rb in twitter-6.0.0

- old
+ new

@@ -70,11 +70,11 @@ # Dynamically define a method for a URI # # @param key1 [Symbol] # @param key2 [Symbol] def define_uri_method(key1, key2) - define_method(key1) do || + define_method(key1) do Addressable::URI.parse(@attrs[key2].chomp('#')) unless @attrs[key2].nil? end memoize(key1) end @@ -82,11 +82,11 @@ # # @param key1 [Symbol] # @param klass [Symbol] # @param key2 [Symbol] def define_attribute_method(key1, klass = nil, key2 = nil) - define_method(key1) do || + define_method(key1) do if attr_falsey_or_empty?(key1) NullObject.new elsif klass.nil? @attrs[key1] else @@ -97,11 +97,11 @@ memoize(key1) end # @param key [Symbol] def deprecate_attribute_method(key) - define_method(key) do || + define_method(key) do warn "#{Kernel.caller.first}: [DEPRECATION] ##{key} is deprecated. Use ##{key}? instead." @attrs[key] end memoize(key) end @@ -109,10 +109,10 @@ # Dynamically define a predicate method for an attribute # # @param key1 [Symbol] # @param key2 [Symbol] def define_predicate_method(key1, key2 = key1) - define_method(:"#{key1}?") do || + define_method(:"#{key1}?") do !attr_falsey_or_empty?(key2) end memoize(:"#{key1}?") end end