Class: Stupidedi::Editor::Error

Inherits:
Result
  • Object
show all
Defined in:
lib/stupidedi/editor/result.rb

Direct Known Subclasses

AK905, ClaimStatus, IK304, IK403, IK502, TA105

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Result

#warning?

Constructor Details

#initialize(zipper, action, code, reason) ⇒ Error

Returns a new instance of Error



60
61
62
63
# File 'lib/stupidedi/editor/result.rb', line 60

def initialize(zipper, action, code, reason)
  @zipper, @action, @code, @reason =
    zipper, action, code, reason
end

Instance Attribute Details

#actionString (readonly)

Returns:

  • (String)


55
56
57
# File 'lib/stupidedi/editor/result.rb', line 55

def action
  @action
end

#codeString (readonly)

Returns:

  • (String)


58
59
60
# File 'lib/stupidedi/editor/result.rb', line 58

def code
  @code
end

#reasonString (readonly)

Returns:

  • (String)


52
53
54
# File 'lib/stupidedi/editor/result.rb', line 52

def reason
  @reason
end

#zipperZipper::AbstractCursor (readonly)



49
50
51
# File 'lib/stupidedi/editor/result.rb', line 49

def zipper
  @zipper
end

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)


71
72
73
# File 'lib/stupidedi/editor/result.rb', line 71

def error?
  true
end

#inspectString

Returns:

  • (String)


66
67
68
69
# File 'lib/stupidedi/editor/result.rb', line 66

def inspect
  name = self.class.name.split('::').last
  "#{name}(#{zipper.node.position.inspect}, #{@reason}, #{@zipper.node.inspect})"
end