Module: DeprecatedFractionalMethods

Included in:
Fractional
Defined in:
lib/deprecated.rb

Instance Method Summary collapse

Instance Method Details

#fraction?(value) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
16
# File 'lib/deprecated.rb', line 13

def fraction?(value)
  warn("Fractional.fraction? will be removed in v1.1\nUse Fractional.string_is_fraction? instead.")
  string_is_fraction?(value)
end

#mixed_fraction?(value) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
21
# File 'lib/deprecated.rb', line 18

def mixed_fraction?(value)
  warn("Fractional.mixed_fraction? will be removed in v1.1\nUse Fractional.string_is_mixed_fraction? instead.")
  string_is_mixed_fraction?(value)
end

#single_fraction?(value) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
26
# File 'lib/deprecated.rb', line 23

def single_fraction?(value)
  warn("Fractional.single_fraction? will be removed in v1.1\nUse Fractional.string_is_single_fraction? instead.")
  string_is_single_fraction?(value)
end

#to_f(value) ⇒ Object



3
4
5
6
# File 'lib/deprecated.rb', line 3

def to_f(value)
  warn("Fractional.to_f will be removed in v1.1.")
  string_to_fraction(value).to_f
end

#to_s(value, options = {}) ⇒ Object



8
9
10
11
# File 'lib/deprecated.rb', line 8

def to_s(value, options={})
  warn("Fractional.to_s will be removed in v1.1\nUse Fractional.new(value).to_s instead.")
  new(float_to_fraction(value)).to_s(options)
end