Class: USPSFlags::Core::Headers
- Inherits:
-
Object
- Object
- USPSFlags::Core::Headers
- Defined in:
- lib/usps_flags/core/headers.rb
Instance Method Summary collapse
-
#initialize(width: nil, height: nil, pennant: false, scale: nil, title: 'USPS Flag') ⇒ Headers
constructor
A new instance of Headers.
- #svg ⇒ Object
Constructor Details
#initialize(width: nil, height: nil, pennant: false, scale: nil, title: 'USPS Flag') ⇒ Headers
Returns a new instance of Headers.
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/usps_flags/core/headers.rb', line 10 def initialize(width: nil, height: nil, pennant: false, scale: nil, title: 'USPS Flag') @width = width @height = height @title = title scale ||= 3 @generated_at = Time.now.strftime('%Y%m%d.%H%S%z') if @width.nil? || @height.nil? no_sizes(scale, pennant) else set_view_size(width, height, scale) end end |
Instance Method Details
#svg ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/usps_flags/core/headers.rb', line 24 def svg svg = +'' svg << header_top svg << trademark unless @title == 'US Ensign' svg << '</metadata>' svg end |