Class: ExtractI18n::Adapters::Adapter
- Inherits:
-
Object
- Object
- ExtractI18n::Adapters::Adapter
- Defined in:
- lib/extract_i18n/adapters/adapter.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#file_key ⇒ Object
readonly
Returns the value of attribute file_key.
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
-
#on_ask ⇒ Object
readonly
Returns the value of attribute on_ask.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(file_key:, on_ask:, options: {}) ⇒ Adapter
constructor
A new instance of Adapter.
- #run(content) ⇒ Object
Constructor Details
#initialize(file_key:, on_ask:, options: {}) ⇒ Adapter
Returns a new instance of Adapter.
15 16 17 18 19 |
# File 'lib/extract_i18n/adapters/adapter.rb', line 15 def initialize(file_key:, on_ask:, options: {}) @on_ask = on_ask @file_key = file_key @options = end |
Instance Attribute Details
#file_key ⇒ Object (readonly)
Returns the value of attribute file_key.
13 14 15 |
# File 'lib/extract_i18n/adapters/adapter.rb', line 13 def file_key @file_key end |
#file_path ⇒ Object (readonly)
Returns the value of attribute file_path.
13 14 15 |
# File 'lib/extract_i18n/adapters/adapter.rb', line 13 def file_path @file_path end |
#on_ask ⇒ Object (readonly)
Returns the value of attribute on_ask.
13 14 15 |
# File 'lib/extract_i18n/adapters/adapter.rb', line 13 def on_ask @on_ask end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
13 14 15 |
# File 'lib/extract_i18n/adapters/adapter.rb', line 13 def @options end |
Class Method Details
.for(file_path) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/extract_i18n/adapters/adapter.rb', line 5 def self.for(file_path) case file_path when /\.rb$/ then RubyAdapter when /\.slim$/ then SlimAdapter when /\.vue$/ then VueAdapter end end |
.supports_relative_keys? ⇒ Boolean
25 26 27 |
# File 'lib/extract_i18n/adapters/adapter.rb', line 25 def self.supports_relative_keys? false end |
Instance Method Details
#run(content) ⇒ Object
21 22 23 |
# File 'lib/extract_i18n/adapters/adapter.rb', line 21 def run(content) raise NotImplementedError end |