Class: Zapnito::Cli::Models::Theme
- Inherits:
-
Object
- Object
- Zapnito::Cli::Models::Theme
- Defined in:
- lib/zapnito/cli/models/theme.rb
Instance Attribute Summary collapse
-
#files ⇒ Object
readonly
Returns the value of attribute files.
-
#revision ⇒ Object
readonly
Returns the value of attribute revision.
-
#tenant_slug ⇒ Object
readonly
Returns the value of attribute tenant_slug.
Instance Method Summary collapse
- #absolute_path_for(file) ⇒ Object
-
#initialize(path) ⇒ Theme
constructor
A new instance of Theme.
- #mime_type_for(file) ⇒ Object
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
#files ⇒ Object (readonly)
Returns the value of attribute files.
5 6 7 |
# File 'lib/zapnito/cli/models/theme.rb', line 5 def files @files end |
#revision ⇒ Object (readonly)
Returns the value of attribute revision.
5 6 7 |
# File 'lib/zapnito/cli/models/theme.rb', line 5 def revision @revision end |
#tenant_slug ⇒ Object (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 |