Class: ThemeCheck::ThemeFile
- Inherits:
-
Object
- Object
- ThemeCheck::ThemeFile
show all
- Defined in:
- lib/theme_check/theme_file.rb
Instance Method Summary
collapse
Constructor Details
#initialize(relative_path, storage) ⇒ ThemeFile
Returns a new instance of ThemeFile.
6
7
8
9
|
# File 'lib/theme_check/theme_file.rb', line 6
def initialize(relative_path, storage)
@relative_path = relative_path
@storage = storage
end
|
Instance Method Details
#==(other) ⇒ Object
Also known as:
eql?
35
36
37
|
# File 'lib/theme_check/theme_file.rb', line 35
def ==(other)
other.is_a?(self.class) && relative_path == other.relative_path
end
|
#json? ⇒ Boolean
27
28
29
|
# File 'lib/theme_check/theme_file.rb', line 27
def json?
false
end
|
#liquid? ⇒ Boolean
31
32
33
|
# File 'lib/theme_check/theme_file.rb', line 31
def liquid?
false
end
|
#name ⇒ Object
19
20
21
|
# File 'lib/theme_check/theme_file.rb', line 19
def name
relative_path.sub_ext('').to_s
end
|
#path ⇒ Object
11
12
13
|
# File 'lib/theme_check/theme_file.rb', line 11
def path
@storage.path(@relative_path)
end
|
#relative_path ⇒ Object
15
16
17
|
# File 'lib/theme_check/theme_file.rb', line 15
def relative_path
@relative_pathname ||= Pathname.new(@relative_path)
end
|
#source ⇒ Object
23
24
25
|
# File 'lib/theme_check/theme_file.rb', line 23
def source
@source ||= @storage.read(@relative_path)
end
|