Class: Codgen::TemplateProviderList
- Inherits:
-
Object
- Object
- Codgen::TemplateProviderList
- Defined in:
- lib/codgen/template_provider.rb
Instance Method Summary collapse
- #add(template_provider) ⇒ Object
- #for_extension(extension) ⇒ Object
-
#initialize ⇒ TemplateProviderList
constructor
A new instance of TemplateProviderList.
- #named(name) ⇒ Object
Constructor Details
#initialize ⇒ TemplateProviderList
Returns a new instance of TemplateProviderList.
67 68 69 70 |
# File 'lib/codgen/template_provider.rb', line 67 def initialize @by_ext = Hash.new @by_name = Hash.new end |
Instance Method Details
#add(template_provider) ⇒ Object
72 73 74 75 76 77 |
# File 'lib/codgen/template_provider.rb', line 72 def add(template_provider) @by_name[template_provider.name] = template_provider if template_provider.extension != nil @by_ext[template_provider.extension] = template_provider end end |
#for_extension(extension) ⇒ Object
79 80 81 |
# File 'lib/codgen/template_provider.rb', line 79 def for_extension(extension) @by_ext[extension] end |
#named(name) ⇒ Object
83 84 85 |
# File 'lib/codgen/template_provider.rb', line 83 def named(name) @by_name[name] end |