Class: Compendium::Param

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/compendium/param_types.rb

Direct Known Subclasses

BooleanParam, DateParam, ParamWithChoices, ScalarParam

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Object



12
13
14
15
# File 'lib/compendium/param_types.rb', line 12

def ==(other)
  return true if (value == other rescue false)
  super
end

#boolean?Boolean

Returns:



7
# File 'lib/compendium/param_types.rb', line 7

def boolean?; false; end

#date?Boolean

Returns:



8
# File 'lib/compendium/param_types.rb', line 8

def date?; false; end

Returns:



9
# File 'lib/compendium/param_types.rb', line 9

def dropdown?; false; end

#nil?Boolean

Need to explicitly delegate nil? to the object, otherwise it’s always false This is because SimpleDelegator is a non-nil object, and it only forwards non-defined methods!

Returns:



19
20
21
# File 'lib/compendium/param_types.rb', line 19

def nil?
  __getobj__.nil?
end

#radio?Boolean

Returns:



10
# File 'lib/compendium/param_types.rb', line 10

def radio?; false; end

#scalar?Boolean

Returns:



6
# File 'lib/compendium/param_types.rb', line 6

def scalar?; false; end