Class: Glimmer::DSL::StaticExpression
- Inherits:
-
Expression
- Object
- Expression
- Glimmer::DSL::StaticExpression
- Defined in:
- lib/glimmer/dsl/static_expression.rb
Overview
Represents a StaticExpression for expressions where the keyword does not vary dynamically. These static keywords are then predefined as methods in Glimmer instead of needing method_missing
StaticExpression subclasses may optionally implement ‘#can_interpret?` (not needed if it only checks for keyword)
StaticExpression subclasses must define ‘#interpret`.
The direct parent namespace of a StaticExpression subclass must match the DSL name (case-insensitive) (e.g. Glimmer::DSL::SWT::WidgetExpression has a DSL of :swt)
Direct Known Subclasses
CSS::CssExpression, CSS::PVExpression, CSS::SExpression, Glimmer::DSL::SWT::AsyncExecExpression, Glimmer::DSL::SWT::BindExpression, Glimmer::DSL::SWT::ColorExpression, Glimmer::DSL::SWT::ColumnPropertiesExpression, Glimmer::DSL::SWT::DisplayExpression, Glimmer::DSL::SWT::LayoutDataExpression, Glimmer::DSL::SWT::MenuBarExpression, Glimmer::DSL::SWT::MenuExpression, Glimmer::DSL::SWT::ObserveExpression, Glimmer::DSL::SWT::ShellExpression, Glimmer::DSL::SWT::SwtExpression, Glimmer::DSL::SWT::SyncExecExpression, Glimmer::DSL::SWT::TabItemExpression, Glimmer::DSL::SWT::TreePropertiesExpression, XML::HtmlExpression, XML::MetaExpression, XML::NameSpaceExpression, XML::TagExpression, XML::TextExpression
Class Method Summary collapse
Instance Method Summary collapse
-
#can_interpret?(parent, keyword, *args, &block) ⇒ Boolean
Subclasses may optionally implement.
Methods inherited from Expression
#add_content, dsl, #interpret, #textual?, #widget?
Class Method Details
.inherited(base) ⇒ Object
22 23 24 25 |
# File 'lib/glimmer/dsl/static_expression.rb', line 22 def inherited(base) Glimmer::DSL::Engine.add_static_expression(base.new) super end |
.keyword ⇒ Object
27 28 29 |
# File 'lib/glimmer/dsl/static_expression.rb', line 27 def keyword @keyword ||= name.split(/::/).last.sub(/Expression$/, '').underscore end |
Instance Method Details
#can_interpret?(parent, keyword, *args, &block) ⇒ Boolean
Subclasses may optionally implement
33 34 35 |
# File 'lib/glimmer/dsl/static_expression.rb', line 33 def can_interpret?(parent, keyword, *args, &block) true end |