Class: Whiteprint::Transform
- Inherits:
-
Parslet::Transform
- Object
- Parslet::Transform
- Whiteprint::Transform
show all
- Defined in:
- lib/whiteprint/transform.rb
Class Method Summary
collapse
Class Method Details
.attribute_expression ⇒ Object
17
18
19
20
21
22
23
|
# File 'lib/whiteprint/transform.rb', line 17
def attribute_expression
{
name: simple(:name),
type: simple(:type),
options: subtree(:options)
}
end
|
.create_rule(name, **expression) ⇒ Object
4
5
6
7
8
|
# File 'lib/whiteprint/transform.rb', line 4
def create_rule(name, **expression)
define_singleton_method name do |&block|
rule(expression, &block)
end
end
|
.table_expression ⇒ Object
10
11
12
13
14
15
|
# File 'lib/whiteprint/transform.rb', line 10
def table_expression
{
table_name: simple(:table_name),
attributes: subtree(:attributes)
}
end
|