Class: Proc
- Inherits:
-
Object
- Object
- Proc
- Defined in:
- lib/ncpp/utils.rb
Instance Method Summary collapse
- #describe(desc) ⇒ Object
- #description ⇒ Object
- #ignore_unk_var_args ⇒ Object
- #ignore_unk_var_at_arg(*arg_idx) ⇒ Object
- #impure ⇒ Object
- #pure? ⇒ Boolean
- #return_type ⇒ Object
- #returns(type) ⇒ Object
Instance Method Details
#describe(desc) ⇒ Object
556 557 558 559 |
# File 'lib/ncpp/utils.rb', line 556 def describe(desc) define_singleton_method(:description) { desc } self end |
#description ⇒ Object
560 561 562 |
# File 'lib/ncpp/utils.rb', line 560 def description nil end |
#ignore_unk_var_args ⇒ Object
544 545 546 |
# File 'lib/ncpp/utils.rb', line 544 def ignore_unk_var_args [] end |
#ignore_unk_var_at_arg(*arg_idx) ⇒ Object
540 541 542 543 |
# File 'lib/ncpp/utils.rb', line 540 def ignore_unk_var_at_arg(*arg_idx) define_singleton_method(:ignore_unk_var_args) { [*arg_idx] } self end |
#impure ⇒ Object
548 549 550 551 |
# File 'lib/ncpp/utils.rb', line 548 def impure define_singleton_method(:pure?) { false } self end |
#pure? ⇒ Boolean
552 553 554 |
# File 'lib/ncpp/utils.rb', line 552 def pure? true # NCPP commands that are Procs are marked as pure by default end |
#return_type ⇒ Object
536 537 538 |
# File 'lib/ncpp/utils.rb', line 536 def return_type nil end |
#returns(type) ⇒ Object
532 533 534 535 |
# File 'lib/ncpp/utils.rb', line 532 def returns(type) define_singleton_method(:return_type) { type } self end |