Class: Pocketbook::Theme::Manifest::Defaults

Inherits:
Object
  • Object
show all
Defined in:
lib/pocketbook/theme/manifest.rb

Instance Method Summary collapse

Constructor Details

#initialize(values, path) ⇒ Defaults

Returns a new instance of Defaults.



12
13
14
15
16
# File 'lib/pocketbook/theme/manifest.rb', line 12

def initialize(values, path)
  @values = values
  @path = path
  validate!
end

Instance Method Details

#metadataObject



22
23
24
25
26
27
28
29
30
31
# File 'lib/pocketbook/theme/manifest.rb', line 22

def 
  return {} if @values.nil?

  @values.each_with_object({}) do |(key, value), output|
    key_name = key.to_s
    next if key_name == "style"

    output[key_name.to_sym] = value
  end
end

#style_nameObject



18
19
20
# File 'lib/pocketbook/theme/manifest.rb', line 18

def style_name
  normalize_optional_string(fetch("style"))
end