Sha256: eb2cda2b13b557d63d19e6b1a99682a4d040163c5194594819a3955b1a7ae0bf

Contents?: true

Size: 961 Bytes

Versions: 7

Compression:

Stored size: 961 Bytes

Contents

# frozen_string_literal: true

module Tramway::Profiles::LinksHelper
  def profile_link(profile)
    send profile.network_name, profile.uid, profile.title
  end

  private

  def vk(uid, title)
    profile_link_template title, "https://vk.com/#{uid}", :vk
  end

  def facebook(uid, title)
    profile_link_template title, "https://facebook.com/#{uid}", :facebook
  end

  def twitter(uid, title)
    profile_link_template title, "https://twitter.com/#{uid}", :twitter
  end

  def instagram(uid, title)
    profile_link_template title, "https://instagram.com/#{uid}", :instagram
  end

  def telegram(uid, title)
    profile_link_template title, "https://intg.me/#{uid}", :telegram
  end

  def patreon(uid, title)
    profile_link_template title, "https://patreon.com/#{uid}", :patreon
  end

  def profile_link_template(title, link, icon)
    link_to link, target: '_blank' do
      concat fab_icon icon
      concat ' '
      concat title
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tramway-profiles-1.4.0.1 app/helpers/tramway/profiles/links_helper.rb
tramway-profiles-1.4 app/helpers/tramway/profiles/links_helper.rb
tramway-profiles-1.3.2.4 app/helpers/tramway/profiles/links_helper.rb
tramway-profiles-1.3.2.3 app/helpers/tramway/profiles/links_helper.rb
tramway-profiles-1.3.2.2 app/helpers/tramway/profiles/links_helper.rb
tramway-profiles-1.3.2.1 app/helpers/tramway/profiles/links_helper.rb
tramway-profiles-1.3.2 app/helpers/tramway/profiles/links_helper.rb