class ExtractI18n::Adapters::Adapter

Attributes

file_key[R]
file_path[R]
on_ask[R]
options[R]

Public Class Methods

for(file_path) click to toggle source
# 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
new(file_key:, on_ask:, options: {}) click to toggle source
# 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 = options
end
supports_relative_keys?() click to toggle source
# File lib/extract_i18n/adapters/adapter.rb, line 25
def self.supports_relative_keys?
  false
end

Public Instance Methods

run(content) click to toggle source
# File lib/extract_i18n/adapters/adapter.rb, line 21
def run(content)
  raise NotImplementedError
end

Private Instance Methods

original_content() click to toggle source
# File lib/extract_i18n/adapters/adapter.rb, line 31
def original_content
  @original_content ||= File.read(file_path)
end