iso639 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -29,7 +29,7 @@ $ gem install iso639
29
29
  require "iso639"
30
30
 
31
31
  # Lookup by alpha-2 codes
32
- Iso639["en"] # => #<Iso639::Language:...>
32
+ Iso639["en"] # => "English"
33
33
  Iso639["en"].alpha2 # => "en"
34
34
  Iso639["en"].alpha3 # => "eng"
35
35
  Iso639["en"].alpha3_bibliographic # => "eng"
@@ -39,7 +39,7 @@ Iso639["en"].english_name # => "English"
39
39
  Iso639["en"].french_name # => "anglais"
40
40
 
41
41
  # Lookup by alpha-3-bibliographic codes
42
- Iso639["fre"] # => #<Iso639::Language:...>
42
+ Iso639["fre"] # => "French"
43
43
  Iso639["fre"].alpha2 # => "fr"
44
44
  Iso639["fre"].alpha3 # => "fre"
45
45
  Iso639["fre"].alpha3_bibliographic # => "fre"
@@ -49,7 +49,7 @@ Iso639["fre"].english_name # => "French"
49
49
  Iso639["fre"].french_name # => "français"
50
50
 
51
51
  # Lookup by alpha-3-terminology codes
52
- Iso639["fra"] # => #<Iso639::Language:...>
52
+ Iso639["fra"] # => "French"
53
53
  Iso639["fra"].alpha2 # => "fr"
54
54
  Iso639["fra"].alpha3 # => "fre"
55
55
  Iso639["fra"].alpha3_bibliographic # => "fre"
@@ -59,7 +59,7 @@ Iso639["fra"].english_name # => "French"
59
59
  Iso639["fra"].french_name # => "français"
60
60
 
61
61
  # Lookup by name
62
- Iso639["German"] # => #<Iso639::Language:...>
62
+ Iso639["German"] # => "German"
63
63
  Iso639["German"].alpha2 # => "de"
64
64
  Iso639["German"].alpha3 # => "ger"
65
65
  Iso639["German"].alpha3_bibliographic # => "ger"
@@ -11,7 +11,7 @@ require "iso639/insensitive_hash"
11
11
  #
12
12
  # Examples
13
13
  #
14
- # Iso639["en"] # => #<Iso639::Language:...>
14
+ # Iso639["en"] # => "English"
15
15
  # Iso639["en"].alpha2 # => "en"
16
16
  # Iso639["en"].alpha3 # => "eng"
17
17
  # Iso639["en"].alpha3_bibliographic # => "eng"
@@ -20,7 +20,7 @@ require "iso639/insensitive_hash"
20
20
  # Iso639["en"].english_name # => "English"
21
21
  # Iso639["en"].french_name # => "anglais"
22
22
  #
23
- # Iso639["German"] # => #<Iso639::Language:...>
23
+ # Iso639["German"] # => "German"
24
24
  # Iso639["German"].alpha2 # => "de"
25
25
  # Iso639["German"].alpha3 # => "ger"
26
26
  # Iso639["German"].alpha3_bibliographic # => "ger"
@@ -51,6 +51,7 @@ module Iso639
51
51
  #
52
52
  # Examples
53
53
  #
54
+ # Iso639["en"] # => "English"
54
55
  # Iso639["en"].alpha3 # => "eng"
55
56
  # Iso639["English"].alpha2 # => "en"
56
57
  # Iso639["FRENCH"].alpha3 # => "fre"
@@ -19,6 +19,10 @@ module Iso639
19
19
  @french_name = strip_to_nil(french_name)
20
20
  end
21
21
 
22
+ def to_s
23
+ name
24
+ end
25
+
22
26
  private
23
27
 
24
28
  def strip_to_nil(val)
@@ -1,3 +1,3 @@
1
1
  module Iso639
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
@@ -33,6 +33,12 @@ describe Iso639::Language do
33
33
  assert_nil lang.french_name
34
34
  end
35
35
 
36
+ it "should return english name for #to_s" do
37
+ lang = Iso639::Language.new "", "", "", "English", ""
38
+ assert_equal "English", lang.to_s
39
+ assert_equal "English", "#{lang}"
40
+ end
41
+
36
42
  it "should not be mutable" do
37
43
  lang = Iso639::Language.new("eng", nil, "en", "English", "anglais").freeze
38
44
  begin
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: iso639
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.2
5
+ version: 1.0.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Ryan McGeary