lib/wcc/media/message.rb in wcc-media-client-0.4.15 vs lib/wcc/media/message.rb in wcc-media-client-0.5.0
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
require_relative 'base'
require_relative 'tag_group'
class WCC::Media::Message < WCC::Media::Base
active_record_shim do
@@ -83,16 +85,16 @@
end
end
def has_video? # rubocop:disable Naming/PredicateName
assets.each_pair
- .any? { |k, v| /video/.match(k) && v && !v.empty? }
+ .any? { |k, v| /video/.match(k) && v && !v.empty? }
end
def has_audio? # rubocop:disable Naming/PredicateName
assets.each_pair
- .any? { |k, v| /^audio/.match(k) && v && !v.empty? }
+ .any? { |k, v| /^audio/.match(k) && v && !v.empty? }
end
def to_param
"#{id}-#{slug}"
end
@@ -105,8 +107,8 @@
define_method(method_name) do
tags.select { |t| t.tag_group == tag_group }
end
end
# pluralize "campus" specifically
- alias_method :campuses, :campus
+ alias campuses campus
remove_method :campus
end