Exception: String::SingleQuoteException
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- String::SingleQuoteException
- Defined in:
- lib/ruby/string/arguments.rb
Overview
the exception raised by String#arguments if an odd number of arguments is encountered. you can still extract the other parts of the parsing via its accessors.
Instance Attribute Summary collapse
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#post ⇒ Object
readonly
Returns the value of attribute post.
-
#pre ⇒ Object
readonly
Returns the value of attribute pre.
Instance Method Summary collapse
-
#initialize(args, index) ⇒ SingleQuoteException
constructor
A new instance of SingleQuoteException.
Constructor Details
#initialize(args, index) ⇒ SingleQuoteException
Returns a new instance of SingleQuoteException.
18 19 20 21 |
# File 'lib/ruby/string/arguments.rb', line 18 def initialize(args, index) @index, @pre, @post = index, args[0,index], args[index+1,args.length-index] super("A single unescaped quote as argument #{index}") end |
Instance Attribute Details
#index ⇒ Object (readonly)
Returns the value of attribute index.
15 16 17 |
# File 'lib/ruby/string/arguments.rb', line 15 def index @index end |
#post ⇒ Object (readonly)
Returns the value of attribute post.
17 18 19 |
# File 'lib/ruby/string/arguments.rb', line 17 def post @post end |
#pre ⇒ Object (readonly)
Returns the value of attribute pre.
16 17 18 |
# File 'lib/ruby/string/arguments.rb', line 16 def pre @pre end |