Class: Zapnito::Cli::Models::Theme

Inherits:
Object
  • Object
show all
Defined in:
lib/zapnito/cli/models/theme.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Theme

Returns a new instance of Theme.



7
8
9
10
11
12
13
# File 'lib/zapnito/cli/models/theme.rb', line 7

def initialize(path)
  @path = with_trailing_slash(path)

  @tenant_slug = File.basename(path)
  @revision = build_revision(@path)
  @files = build_files(@path)
end

Instance Attribute Details

#filesObject (readonly)

Returns the value of attribute files.



5
6
7
# File 'lib/zapnito/cli/models/theme.rb', line 5

def files
  @files
end

#revisionObject (readonly)

Returns the value of attribute revision.



5
6
7
# File 'lib/zapnito/cli/models/theme.rb', line 5

def revision
  @revision
end

#tenant_slugObject (readonly)

Returns the value of attribute tenant_slug.



5
6
7
# File 'lib/zapnito/cli/models/theme.rb', line 5

def tenant_slug
  @tenant_slug
end

Instance Method Details

#absolute_path_for(file) ⇒ Object



15
16
17
# File 'lib/zapnito/cli/models/theme.rb', line 15

def absolute_path_for(file)
  File.join(@path, file)
end

#mime_type_for(file) ⇒ Object



19
20
21
# File 'lib/zapnito/cli/models/theme.rb', line 19

def mime_type_for(file)
  Utils.mime_type_for(file)
end