Class: PwaManifestGenerator::Screenshot

Inherits:
Object
  • Object
show all
Defined in:
lib/pwa_manifest_generator/screenshot.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(src:, sizes:, type:, label: nil) ⇒ Screenshot

Returns a new instance of Screenshot.



7
8
9
10
11
12
# File 'lib/pwa_manifest_generator/screenshot.rb', line 7

def initialize(src:, sizes:, type:, label: nil)
  @src = src
  @sizes = sizes
  @type = type
  @label = label
end

Instance Attribute Details

#labelObject

Returns the value of attribute label.



5
6
7
# File 'lib/pwa_manifest_generator/screenshot.rb', line 5

def label
  @label
end

#sizesObject

Returns the value of attribute sizes.



5
6
7
# File 'lib/pwa_manifest_generator/screenshot.rb', line 5

def sizes
  @sizes
end

#srcObject

Returns the value of attribute src.



5
6
7
# File 'lib/pwa_manifest_generator/screenshot.rb', line 5

def src
  @src
end

#typeObject

Returns the value of attribute type.



5
6
7
# File 'lib/pwa_manifest_generator/screenshot.rb', line 5

def type
  @type
end

Instance Method Details

#to_hObject



14
15
16
17
18
# File 'lib/pwa_manifest_generator/screenshot.rb', line 14

def to_h
  h = { src: @src, sizes: @sizes, type: @type }
  h[:label] = @label if @label
  h
end