Class: Curry::SpiceArg

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

Overview

Just a base class for ‘active’ special spices (holes, really). SpiceArgs have a spice_arg method that must return an array. Maybe you can subclass up your own special spices…

All the standard subclasses are singletons, the instance of which is assigned to the appropriate constant (HOLE, BLACKHOLE, etc).

Direct Known Subclasses

AntiSpiceArg, BlackHoleArg, HoleArg, LazySpice

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ SpiceArg

Returns a new instance of SpiceArg.



68
69
70
# File 'lib/curry.rb', line 68

def initialize(name)
  @name = name
end

Instance Method Details

#inspectObject



76
77
78
# File 'lib/curry.rb', line 76

def inspect
  "<#{@name}>"
end

#spice_arg(args_remain) ⇒ Object

Raises:

  • (NoMethodError)


72
73
74
# File 'lib/curry.rb', line 72

def spice_arg(args_remain)
  raise NoMethodError, "Abstract method"
end