Class: FalseClass

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

Instance Method Summary collapse

Instance Method Details

#f(format = :yn) ⇒ Object

Format to a selected format (see TrueClass also)

Format Options:
  yn: No
  tf: False
  icon: glyphicon (Bootstrap)
  num: 0


26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/waxx/patch.rb', line 26

def f(format=:yn)
  case format.to_sym
    when :yn
      "No"
    when :tf
      "False"
    when :icon
      '<span class="glyphicon glyphicon-minus" aria-hidden="true"></span>'
    when :num
      "0"
    else
      raise "Unknown format in FalseClass.f: #{format}. Needs to be :yn, :tf, :icon, or :num."
  end
end

#hObject

HTML format “false”



17
18
19
# File 'lib/waxx/patch.rb', line 17

def h
  "false"
end

#to_iObject

Show false as zero



41
42
43
# File 'lib/waxx/patch.rb', line 41

def to_i
  0
end