Class: Pocketbook::Theme::AssetPaths

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root_path:, manifest:, style: nil, template_override: nil) ⇒ AssetPaths

Returns a new instance of AssetPaths.



41
42
43
44
45
46
47
48
49
50
# File 'lib/pocketbook/theme.rb', line 41

def initialize(root_path:, manifest:, style: nil, template_override: nil)
  @root_path = root_path
  @manifest = manifest
  @style_map = build_style_map
  @available_styles = @style_map.keys.sort

  @template_path = resolve_template_path(template_override)
  @style_name = resolve_style_name(style)
  @style_paths = resolve_style_paths(@style_name)
end

Instance Attribute Details

#available_stylesObject (readonly)

Returns the value of attribute available_styles.



39
40
41
# File 'lib/pocketbook/theme.rb', line 39

def available_styles
  @available_styles
end

#style_nameObject (readonly)

Returns the value of attribute style_name.



39
40
41
# File 'lib/pocketbook/theme.rb', line 39

def style_name
  @style_name
end

#style_pathsObject (readonly)

Returns the value of attribute style_paths.



39
40
41
# File 'lib/pocketbook/theme.rb', line 39

def style_paths
  @style_paths
end

#template_pathObject (readonly)

Returns the value of attribute template_path.



39
40
41
# File 'lib/pocketbook/theme.rb', line 39

def template_path
  @template_path
end