Class: SeeingIsBelieving::ExpressionList::PendingExpression

Inherits:
Struct
  • Object
show all
Defined in:
lib/seeing_is_believing/expression_list.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#childrenObject

Returns the value of attribute children

Returns:

  • (Object)

    the current value of children



8
9
10
# File 'lib/seeing_is_believing/expression_list.rb', line 8

def children
  @children
end

#expressionObject

Returns the value of attribute expression

Returns:

  • (Object)

    the current value of expression



8
9
10
# File 'lib/seeing_is_believing/expression_list.rb', line 8

def expression
  @expression
end

Instance Method Details

#inspect(debug = false) ⇒ Object

coloured debug because there’s so much syntax that I get lost trying to parse the output



10
11
12
13
14
15
# File 'lib/seeing_is_believing/expression_list.rb', line 10

def inspect(debug=false)
  colour1 = colour2 = lambda { |s| s }
  colour1 = lambda { |s| "\e[30;46m#{s}\e[0m" } if debug
  colour2 = lambda { |s| "\e[37;46m#{s}\e[0m" } if debug
  "#{colour1['PE(']}#{colour2[expression.inspect]}#{colour1[',' ]}#{colour2[children.inspect]}#{colour1[')']}"
end