Class: USPSFlags::Core::Icons::Trumpet

Inherits:
Object
  • Object
show all
Defined in:
lib/usps_flags/core/icons/trumpet.rb

Instance Method Summary collapse

Constructor Details

#initialize(type: :s) ⇒ Trumpet

Returns a new instance of Trumpet.



11
12
13
14
# File 'lib/usps_flags/core/icons/trumpet.rb', line 11

def initialize(type: :s)
  @color = type == :n ? USPSFlags::Config::BLUE : USPSFlags::Config::RED
  @count = type == :s ? 1 : 2
end

Instance Method Details

#svgObject



16
17
18
19
20
21
22
23
24
25
# File 'lib/usps_flags/core/icons/trumpet.rb', line 16

def svg
  if @count == 2
    <<~SVG
      <g transform="translate(1100,-600)"><g transform="rotate(45)">#{trumpet}</g></g>
      <g transform="translate(-300,1100)"><g transform="rotate(-45)">#{trumpet}</g></g>
    SVG
  else
    trumpet
  end
end