Class: TrueClass

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 FalseClass also)

Format Options:
  yn: Yes
  tf: True
  icon: glyphicon (Bootstrap)
  num: 1


121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/waxx/patch.rb', line 121

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

#hObject



112
113
114
# File 'lib/waxx/patch.rb', line 112

def h
  "true"
end

#to_iObject

Show true as 1



135
136
137
# File 'lib/waxx/patch.rb', line 135

def to_i
  1
end