Class: CGenerator::MethodPrototype::RbScanArgsSpec
- Inherits:
-
Object
- Object
- CGenerator::MethodPrototype::RbScanArgsSpec
- Defined in:
- lib/cgen/cgen.rb
Instance Method Summary collapse
- #block(arg) ⇒ Object
- #default(arg) ⇒ Object
- #get_block ⇒ Object
- #get_default ⇒ Object
- #get_optional ⇒ Object
- #get_required ⇒ Object
- #get_rest ⇒ Object
- #get_typecheck ⇒ Object
-
#initialize(bl) ⇒ RbScanArgsSpec
constructor
A new instance of RbScanArgsSpec.
- #optional(*args) ⇒ Object
- #required(*args) ⇒ Object
- #rest(arg) ⇒ Object
- #typecheck(arg) ⇒ Object
Constructor Details
#initialize(bl) ⇒ RbScanArgsSpec
Returns a new instance of RbScanArgsSpec.
1786 1787 1788 1789 1790 1791 |
# File 'lib/cgen/cgen.rb', line 1786 def initialize bl @required = @optional = @typecheck = @default = @rest = @block = nil if bl instance_eval(&bl) end end |
Instance Method Details
#block(arg) ⇒ Object
1798 |
# File 'lib/cgen/cgen.rb', line 1798 def block(arg); @block = arg; end |
#default(arg) ⇒ Object
1796 |
# File 'lib/cgen/cgen.rb', line 1796 def default(arg); @default = arg; end |
#get_block ⇒ Object
1805 |
# File 'lib/cgen/cgen.rb', line 1805 def get_block; @block; end |
#get_default ⇒ Object
1803 |
# File 'lib/cgen/cgen.rb', line 1803 def get_default; @default; end |
#get_optional ⇒ Object
1801 |
# File 'lib/cgen/cgen.rb', line 1801 def get_optional; @optional; end |
#get_required ⇒ Object
1800 |
# File 'lib/cgen/cgen.rb', line 1800 def get_required; @required; end |
#get_rest ⇒ Object
1804 |
# File 'lib/cgen/cgen.rb', line 1804 def get_rest; @rest; end |
#get_typecheck ⇒ Object
1802 |
# File 'lib/cgen/cgen.rb', line 1802 def get_typecheck; @typecheck; end |
#optional(*args) ⇒ Object
1794 |
# File 'lib/cgen/cgen.rb', line 1794 def optional(*args); @optional = args; end |
#required(*args) ⇒ Object
1793 |
# File 'lib/cgen/cgen.rb', line 1793 def required(*args); @required = args; end |
#rest(arg) ⇒ Object
1797 |
# File 'lib/cgen/cgen.rb', line 1797 def rest(arg); @rest = arg; end |
#typecheck(arg) ⇒ Object
1795 |
# File 'lib/cgen/cgen.rb', line 1795 def typecheck(arg); @typecheck = arg; end |