Class: C0::Diff::Unit

Inherits:
Struct
  • Object
show all
Defined in:
lib/c0/diff.rb

Overview

One unit of a pattern: an anchor (new nil) or a substitution old␚␟new (new the sub-unit of old).

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#new ⇒ Object

Returns the value of attribute new

Returns:

  • (Object) —

    the current value of new



29
30
31
# File 'lib/c0/diff.rb', line 29

def new
  @new
end

#old ⇒ Object

Returns the value of attribute old

Returns:

  • (Object) —

    the current value of old



29
30
31
# File 'lib/c0/diff.rb', line 29

def old
  @old
end

Instance Method Details

#anchor? ⇒ Boolean

Returns:

  • (Boolean)


30
# File 'lib/c0/diff.rb', line 30

def anchor? = new.nil?

#substitution? ⇒ Boolean

Returns:

  • (Boolean)


32
# File 'lib/c0/diff.rb', line 32

def substitution? = !new.nil?