Class: Nydp::Literal
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Helper
#cons, #list, #literal?, #pair?, #sig, #sym, #sym?
Methods included from Converter
#n2r, #r2n, #rubify
Constructor Details
#initialize(expression) ⇒ Literal
Returns a new instance of Literal.
6
7
8
|
# File 'lib/nydp/literal.rb', line 6
def initialize expression
@expression = expression
end
|
Instance Attribute Details
#expression ⇒ Object
Returns the value of attribute expression.
4
5
6
|
# File 'lib/nydp/literal.rb', line 4
def expression
@expression
end
|
Class Method Details
.build(expression, bindings, ns) ⇒ Object
10
11
12
|
# File 'lib/nydp/literal.rb', line 10
def self.build expression, bindings, ns
new expression
end
|
Instance Method Details
27
28
29
|
# File 'lib/nydp/literal.rb', line 27
def < other
other > expression
end
|
#==(other) ⇒ Object
31
32
33
|
# File 'lib/nydp/literal.rb', line 31
def == other
other.is_a?(Literal) && (self.expression == other.expression)
end
|
23
24
25
|
# File 'lib/nydp/literal.rb', line 23
def > other
other < expression
end
|
#compile_to_ruby(indent, srcs, opts = nil) ⇒ Object
14
15
16
|
# File 'lib/nydp/literal.rb', line 14
def compile_to_ruby indent, srcs, opts=nil
"#{indent}#{expression.compile_to_ruby "", srcs}"
end
|
19
|
# File 'lib/nydp/literal.rb', line 19
def inspect ; @expression.inspect ; end
|
#nydp_type ⇒ Object
18
|
# File 'lib/nydp/literal.rb', line 18
def nydp_type ; :literal ; end
|
21
|
# File 'lib/nydp/literal.rb', line 21
def to_ruby ; n2r @expression ; end
|
20
|
# File 'lib/nydp/literal.rb', line 20
def to_s ; @expression.to_s ; end
|