Module: Curly
- Defined in:
- lib/curly.rb,
lib/curly/error.rb,
lib/curly/rspec.rb,
lib/curly/railtie.rb,
lib/curly/scanner.rb,
lib/curly/version.rb,
lib/curly/compiler.rb,
lib/curly/presenter.rb,
lib/generators/curly.rb,
lib/curly/syntax_error.rb,
lib/curly/attribute_scanner.rb,
lib/curly/component_scanner.rb,
lib/curly/invalid_component.rb,
lib/curly/component_compiler.rb,
lib/curly/dependency_tracker.rb,
lib/curly/presenter_not_found.rb,
lib/curly/presenter_name_error.rb,
lib/curly/incomplete_block_error.rb,
lib/curly/incorrect_ending_error.rb,
lib/generators/curly/install/install_generator.rb,
lib/generators/curly/scaffold/scaffold_generator.rb,
lib/generators/curly/controller/controller_generator.rb
Overview
:nodoc:
Defined Under Namespace
Modules: Generators, RSpec Classes: AttributeScanner, Compiler, ComponentCompiler, ComponentScanner, DependencyTracker, Error, IncompleteBlockError, IncorrectEndingError, InvalidComponent, Parser, Presenter, PresenterNameError, PresenterNotFound, Railtie, Scanner, SyntaxError, TemplateHandler
Constant Summary collapse
- VERSION =
"3.4.0"
- AttributeError =
Class.new(Curly::Error)
Class Method Summary collapse
-
.compile(template, presenter_class) ⇒ Object
Compiles a Curly template to Ruby code.
-
.valid?(template, presenter_class) ⇒ Boolean
Whether the Curly template is valid.
Class Method Details
.compile(template, presenter_class) ⇒ Object
Compiles a Curly template to Ruby code.
template - The template String that should be compiled.
Returns a String containing the Ruby code.
34 35 36 |
# File 'lib/curly.rb', line 34 def self.compile(template, presenter_class) Compiler.compile(template, presenter_class) end |
.valid?(template, presenter_class) ⇒ Boolean
Whether the Curly template is valid. This includes whether all components are available on the presenter class.
template - The template String that should be validated. presenter_class - The presenter Class.
Returns true if the template is valid, false otherwise.
45 46 47 |
# File 'lib/curly.rb', line 45 def self.valid?(template, presenter_class) Compiler.valid?(template, presenter_class) end |