Class: Proc

Inherits:
Object
  • Object
show all
Defined in:
lib/ncpp/utils.rb

Instance Method Summary collapse

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

#descriptionObject



560
561
562
# File 'lib/ncpp/utils.rb', line 560

def description
  nil
end

#ignore_unk_var_argsObject



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

#impureObject



548
549
550
551
# File 'lib/ncpp/utils.rb', line 548

def impure
  define_singleton_method(:pure?) { false }
  self
end

#pure?Boolean

Returns:

  • (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_typeObject



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