Module: Humanized::English::Articles

Included in:
Humanized::English
Defined in:
lib/humanized/interpolation/english.rb

Instance Method Summary collapse

Instance Method Details

#a(humanizer, *args) ⇒ Object



23
24
25
26
27
28
29
30
31
32
# File 'lib/humanized/interpolation/english.rb', line 23

def a(humanizer, *args)
  Wrapper.wrap(args) do |t|
    fs = first_sound(humanizer, t)
    s = t.to_s
    if( fs.nil? )
      fs = guess_first_sound(s)
    end
    (fs == :vowel ? 'an' : 'a' ) + ' ' + s
  end
end

#no(humanizer, *args) ⇒ Object



40
41
42
43
44
# File 'lib/humanized/interpolation/english.rb', line 40

def no(humanizer, *args)
  Wrapper.wrap(args) do |t|
    'no ' + t.to_s
  end
end

#some(humanizer, *args) ⇒ Object



46
47
48
49
50
# File 'lib/humanized/interpolation/english.rb', line 46

def some(humanizer, *args)
  Wrapper.wrap(args) do |t|
    'some ' + t.to_s
  end
end

#the(humanizer, *args) ⇒ Object



34
35
36
37
38
# File 'lib/humanized/interpolation/english.rb', line 34

def the(humanizer, *args)
  Wrapper.wrap(args) do |t|
    'the ' + t.to_s
  end
end