Class: FA::Link

Inherits:
Base
  • Object
show all
Defined in:
lib/fa/link.rb

Overview

FontAwesome 5 (Pro) Helper for generating CDN links

Since:

  • 0.1.0

Instance Method Summary collapse

Methods inherited from Base

#safe

Constructor Details

#initialize(version:, integrity:, pro: true) ⇒ Link

Outputs the CDN link.

Since:

  • 0.1.0



7
8
9
10
11
# File 'lib/fa/link.rb', line 7

def initialize(version:, integrity:, pro: true)
  @version = version
  @integrity = integrity
  @subdomain = pro ? 'pro' : 'use'
end

Instance Method Details

#rawObject

Outputs the formatted link directly.

Since:

  • 0.1.0



14
15
16
17
# File 'lib/fa/link.rb', line 14

def raw
  "<link rel=\"stylesheet\" href=\"#{url}\" " \
  "integrity=\"#{@integrity}\" crossorigin=\"anonymous\">"
end