Module: Identitee::Identify
- Defined in:
- lib/identitee/identify.rb,
lib/identitee/identify/find_alias.rb
Defined Under Namespace
Modules: FindAlias
Instance Method Summary collapse
- #all_identifiables ⇒ Object
- #find_identifiable(candidate_id) ⇒ Object
- #find_identifiable_key(instance) ⇒ Object
- #identifiables ⇒ Object
- #identify(id, *extra_parameters, &block) ⇒ Object
- #identify_root_directory ⇒ Object
- #load_all_identifiables ⇒ Object
- #set_identitee_root(path_to_template_root) ⇒ Object
Instance Method Details
#all_identifiables ⇒ Object
25 26 27 28 |
# File 'lib/identitee/identify.rb', line 25 def all_identifiables load_all_identifiables identifiables.all end |
#find_identifiable(candidate_id) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/identitee/identify.rb', line 14 def find_identifiable candidate_id identifiables.find candidate_id.to_s do ::Identitee::Loader.new(identify_root_directory: identify_root_directory).lazy_load(candidate_id.to_s) identifiables.find candidate_id, "Unknown" end end |
#find_identifiable_key(instance) ⇒ Object
21 22 23 |
# File 'lib/identitee/identify.rb', line 21 def find_identifiable_key instance identifiables.find_key instance end |
#identifiables ⇒ Object
42 43 44 |
# File 'lib/identitee/identify.rb', line 42 def identifiables @identifiables ||= Identifiables.new end |
#identify(id, *extra_parameters, &block) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/identitee/identify.rb', line 6 def identify id, *extra_parameters, &block instance = new *extra_parameters instance.instance_eval &block if block_given? identifiables.register id, instance instance end |
#identify_root_directory ⇒ Object
38 39 40 |
# File 'lib/identitee/identify.rb', line 38 def identify_root_directory @identify_root_directory end |
#load_all_identifiables ⇒ Object
30 31 32 |
# File 'lib/identitee/identify.rb', line 30 def load_all_identifiables ::Identitee::Loader.new(identify_root_directory: identify_root_directory).load_all end |
#set_identitee_root(path_to_template_root) ⇒ Object
34 35 36 |
# File 'lib/identitee/identify.rb', line 34 def set_identitee_root path_to_template_root @identify_root_directory = path_to_template_root end |