Class: Antelope::Ace::Scanner::Argument
- Inherits:
-
String
- Object
- String
- Antelope::Ace::Scanner::Argument
- Defined in:
- lib/antelope/ace/scanner/argument.rb
Overview
Represents an argument to a directive. It encapsulates a string object, which is the value of the argument.
Instance Method Summary collapse
-
#block? ⇒ Boolean
If this argument is type
:block
. -
#caret? ⇒ Boolean
If this argument is type
:caret
. -
#initialize(type, value) ⇒ Argument
constructor
Initialize the argument.
-
#text? ⇒ Boolean
If this argument is type
:text
. -
#type?(*inc) ⇒ Boolean
Checks to see if any of the given arguments match the type of this argument.
Constructor Details
#initialize(type, value) ⇒ Argument
Initialize the argument.
17 18 19 20 |
# File 'lib/antelope/ace/scanner/argument.rb', line 17 def initialize(type, value) @type = type super(value) end |
Instance Method Details
#block? ⇒ Boolean
If this argument is type :block
.
26 27 28 |
# File 'lib/antelope/ace/scanner/argument.rb', line 26 def block? type? :block end |
#caret? ⇒ Boolean
If this argument is type :caret
.
42 43 44 |
# File 'lib/antelope/ace/scanner/argument.rb', line 42 def caret? type? :caret end |
#text? ⇒ Boolean
If this argument is type :text
.
34 35 36 |
# File 'lib/antelope/ace/scanner/argument.rb', line 34 def text? type? :text end |
#type?(*inc) ⇒ Boolean
Checks to see if any of the given arguments match the type of this argument.
51 52 53 |
# File 'lib/antelope/ace/scanner/argument.rb', line 51 def type?(*inc) inc.include?(@type) end |