Exception: Glossarist::Mentions::InvalidMentionError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/glossarist/mentions/invalid_mention_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw:, reason:, position: 0) ⇒ InvalidMentionError

Returns a new instance of InvalidMentionError.



8
9
10
11
12
13
# File 'lib/glossarist/mentions/invalid_mention_error.rb', line 8

def initialize(raw:, reason:, position: 0)
  @raw = raw
  @reason = reason
  @position = position
  super("Invalid mention at position #{position}: #{reason}")
end

Instance Attribute Details

#positionObject (readonly)

Returns the value of attribute position.



6
7
8
# File 'lib/glossarist/mentions/invalid_mention_error.rb', line 6

def position
  @position
end

#rawObject (readonly)

Returns the value of attribute raw.



6
7
8
# File 'lib/glossarist/mentions/invalid_mention_error.rb', line 6

def raw
  @raw
end

#reasonObject (readonly)

Returns the value of attribute reason.



6
7
8
# File 'lib/glossarist/mentions/invalid_mention_error.rb', line 6

def reason
  @reason
end