Class: Speculations::Data

Inherits:
Object
  • Object
show all
Defined in:
lib/speculations/data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ctxtObject (readonly)

Returns the value of attribute ctxt.



5
6
7
# File 'lib/speculations/data.rb', line 5

def ctxt
  @ctxt
end

#debugObject (readonly)

Returns the value of attribute debug.



5
6
7
# File 'lib/speculations/data.rb', line 5

def debug
  @debug
end

#lineObject (readonly)

Returns the value of attribute line.



5
6
7
# File 'lib/speculations/data.rb', line 5

def line
  @line
end

#lnbObject (readonly)

Returns the value of attribute lnb.



5
6
7
# File 'lib/speculations/data.rb', line 5

def lnb
  @lnb
end

#nodeObject (readonly)

Returns the value of attribute node.



5
6
7
# File 'lib/speculations/data.rb', line 5

def node
  @node
end

#stateObject (readonly)

Returns the value of attribute state.



5
6
7
# File 'lib/speculations/data.rb', line 5

def state
  @state
end

Instance Method Details

#info(label) ⇒ Object



7
# File 'lib/speculations/data.rb', line 7

def info(label) = node.info(label)

#up_to_context(new_state = nil) ⇒ Object



9
# File 'lib/speculations/data.rb', line 9

def up_to_context(new_state=nil) = update(state: new_state || ctxt, node: node.parent)

#update(lnb: nil, line: nil, state: nil, node: nil, ctxt: nil) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/speculations/data.rb', line 11

def update(lnb: nil, line: nil, state: nil, node: nil, ctxt: nil)
  @ctxt = ctxt if ctxt
  @debug = debug if debug
  @line = line if line
  @lnb = lnb if lnb
  @node = node if node
  @state = state if state
  self
end