Class: BootstrapPager::Generators::Theme
- Inherits:
-
Object
- Object
- BootstrapPager::Generators::Theme
- Defined in:
- lib/generators/bootstrap_pager/views_generator.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#description ⇒ Object
:nodoc:.
-
#initialize(name, templates) ⇒ Theme
constructor
:nodoc:.
-
#templates_for(template_engine) ⇒ Object
:nodoc:.
Constructor Details
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
80 81 82 |
# File 'lib/generators/bootstrap_pager/views_generator.rb', line 80 def name @name end |
Instance Method Details
#description ⇒ Object
:nodoc:
85 86 87 88 89 |
# File 'lib/generators/bootstrap_pager/views_generator.rb', line 85 def description #:nodoc: file = @templates.detect(&:description?) return "#{' ' * 12}#{name}" unless file GitHubApiHelper.get_content_for("#{@name}/#{file.name}").chomp.gsub(/^/, ' ' * 12) end |
#templates_for(template_engine) ⇒ Object
:nodoc:
91 92 93 |
# File 'lib/generators/bootstrap_pager/views_generator.rb', line 91 def templates_for(template_engine) #:nodoc: @templates.select {|t| !t.description?}.select {|t| !t.view? || (t.engine == template_engine)} end |