lib/burgundy/rails.rb in burgundy-0.3.0 vs lib/burgundy/rails.rb in burgundy-0.4.0
- old
+ new
@@ -1,14 +1,18 @@
+# frozen_string_literal: true
+
module Burgundy
module UrlMethods
def default_url_options
action_mailer_default_url_options ||
- Rails.application.routes.default_url_options
+ Rails.application.routes.default_url_options
end
def action_mailer_default_url_options
- Rails.configuration.action_mailer.default_url_options if Rails.configuration.respond_to?(:action_mailer)
+ return unless Rails.configuration.respond_to?(:action_mailer)
+
+ Rails.configuration.action_mailer.default_url_options
end
end
module Helpers
extend ActiveSupport::Concern
@@ -18,11 +22,11 @@
end
def helpers
ApplicationController.helpers
end
- alias_method :h, :helpers
+ alias h helpers
end
module RouteHelpers
extend ActiveSupport::Concern
@@ -41,17 +45,17 @@
def to_param
item.to_param
end
- def eql?(obj)
- obj == self || item.eql?(obj)
+ def eql?(other)
+ other == self || item.eql?(other)
end
def routes
self.class.routes
end
- alias_method :r, :routes
+ alias r routes
end
class Item
include Helpers
include RouteHelpers