Module: Miteru::Concerns::UrlTruncatable

Extended by:
ActiveSupport::Concern
Included in:
Kit, Website
Defined in:
lib/miteru/concerns/url_truncatable.rb

Instance Method Summary collapse

Instance Method Details

#decoded_urlObject



8
9
10
# File 'lib/miteru/concerns/url_truncatable.rb', line 8

def decoded_url
  @decoded_url ||= URI.decode_www_form_component(url)
end

#defanged_truncated_urlObject



19
20
21
# File 'lib/miteru/concerns/url_truncatable.rb', line 19

def defanged_truncated_url
  @defanged_truncated_url ||= truncated_url.to_s.gsub(".", "[.]")
end

#truncated_urlString

Returns:

  • (String)


15
16
17
# File 'lib/miteru/concerns/url_truncatable.rb', line 15

def truncated_url
  @truncated_url ||= decoded_url.truncate(64)
end