Class: ThemeCheck::JsonFile
- Inherits:
-
Object
- Object
- ThemeCheck::JsonFile
- Defined in:
- lib/theme_check/json_file.rb
Instance Method Summary collapse
- #content ⇒ Object
-
#initialize(relative_path, storage) ⇒ JsonFile
constructor
A new instance of JsonFile.
- #name ⇒ Object
- #parse_error ⇒ Object
- #path ⇒ Object
- #relative_path ⇒ Object
Constructor Details
#initialize(relative_path, storage) ⇒ JsonFile
Returns a new instance of JsonFile.
7 8 9 10 11 12 13 |
# File 'lib/theme_check/json_file.rb', line 7 def initialize(relative_path, storage) @relative_path = relative_path @storage = storage @loaded = false @content = nil @parser_error = nil end |
Instance Method Details
#content ⇒ Object
23 24 25 26 |
# File 'lib/theme_check/json_file.rb', line 23 def content load! @content end |
#name ⇒ Object
33 34 35 |
# File 'lib/theme_check/json_file.rb', line 33 def name relative_path.sub_ext('').to_s end |
#parse_error ⇒ Object
28 29 30 31 |
# File 'lib/theme_check/json_file.rb', line 28 def parse_error load! @parser_error end |
#path ⇒ Object
15 16 17 |
# File 'lib/theme_check/json_file.rb', line 15 def path @storage.path(@relative_path) end |
#relative_path ⇒ Object
19 20 21 |
# File 'lib/theme_check/json_file.rb', line 19 def relative_path @relative_pathname ||= Pathname.new(@relative_path) end |