Module: JustimmoClient::Utils Private
- Included in:
- JustimmoClient, V1, V1::EmployeeInterface, V1::JSON, V1::JustimmoBase, V1::RealtyInterface, V1::XML
- Defined in:
- lib/justimmo_client/core/utils.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Useful utility methods
Instance Method Summary collapse
- #autoload_dir(path) ⇒ Object private
- #translate(text) ⇒ Object private
Instance Method Details
#autoload_dir(path) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
9 10 11 12 13 14 15 16 |
# File 'lib/justimmo_client/core/utils.rb', line 9 def autoload_dir(path) dirname = File.dirname(path) Dir[path].each do |f| basename = File.basename(f, ".rb") send :autoload, basename.classify, File.join(dirname, basename) end end |
#translate(text) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
18 19 20 21 22 |
# File 'lib/justimmo_client/core/utils.rb', line 18 def translate(text) I18n.translate("justimmo_client.#{text}", raise: true) rescue I18n::MissingTranslationData text.split(".").last.titleize end |