File tree Expand file tree Collapse file tree 1 file changed +15
-17
lines changed Expand file tree Collapse file tree 1 file changed +15
-17
lines changed Original file line number Diff line number Diff line change 1
1
class Settings ::SyntaxHighlight
2
2
include ActiveModel ::Model
3
3
4
- class << self
5
- def default
6
- find ( "dracula" )
7
- end
4
+ def self . default
5
+ find ( "dracula" )
6
+ end
8
7
9
- def find ( name )
10
- attrs = curated_data . find { |attrs | attrs [ :name ] == name }
11
- if attrs . present?
12
- new ( **attrs )
13
- else
14
- raise ActiveRecord ::RecordNotFound , "Couldn't find SyntaxHighlight with name '#{ name } '"
15
- end
8
+ def self . find ( name )
9
+ attrs = curated_data . find { |attrs | attrs [ :name ] == name }
10
+ if attrs . present?
11
+ new ( **attrs )
12
+ else
13
+ raise ActiveRecord ::RecordNotFound , "Couldn't find SyntaxHighlight with name '#{ name } '"
16
14
end
15
+ end
17
16
18
- def curated
19
- curated_data . map { |attrs | new ( **attrs ) }
20
- end
17
+ def self . curated
18
+ curated_data . map { |attrs | new ( **attrs ) }
19
+ end
21
20
22
- def curated_data
23
- @curated_data ||= YAML . load_file ( Rails . root . join ( "config" , "syntax_highlights.yml" ) )
24
- end
21
+ def self . curated_data
22
+ @curated_data ||= YAML . load_file ( Rails . root . join ( "config" , "syntax_highlights.yml" ) )
25
23
end
26
24
27
25
attr_accessor :name , :mode
You can’t perform that action at this time.
0 commit comments