Class: CountryCodes::Country

Inherits:
Object
  • Object
show all
Includes:
Internal::Helpers
Defined in:
lib/country_codes/country.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Internal::Helpers

included, #pack_seq, #unpack_seq, #unpack_some

Constructor Details

#initialize(java_country) ⇒ Country

Note:

This code is not supposed to be used externally!

Wraps an instance of io.wunderschild.country_codes.Country to be used in Ruby.



25
26
27
# File 'lib/country_codes/country.rb', line 25

def initialize(java_country)
  @country = java_country
end

Instance Attribute Details

#alpha2String (readonly)



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/country_codes/country.rb', line 18

class Country
  include Internal::Helpers

  # Wraps an instance of `io.wunderschild.country_codes.Country` to be used in Ruby.
  #
  # @note This code is not supposed to be used externally!
  # @param [JavaLangObject] java_country An instance of `io.wunderschild.country_codes.Country`
  def initialize(java_country)
    @country = java_country
  end

  delegate :alpha2, :alpha3, :official_name, to: :country
  delegate :nationality, :sovereignty, to: :country, interceptors: :unpack_some
  delegate :other_names, to: :country, interceptors: i[unpack_some unpack_seq array_no_nil]

  private

  attr_reader :country

  def array_no_nil(array)
    array.nil? ? [] : array
  end
end

#alpha3String (readonly)



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/country_codes/country.rb', line 18

class Country
  include Internal::Helpers

  # Wraps an instance of `io.wunderschild.country_codes.Country` to be used in Ruby.
  #
  # @note This code is not supposed to be used externally!
  # @param [JavaLangObject] java_country An instance of `io.wunderschild.country_codes.Country`
  def initialize(java_country)
    @country = java_country
  end

  delegate :alpha2, :alpha3, :official_name, to: :country
  delegate :nationality, :sovereignty, to: :country, interceptors: :unpack_some
  delegate :other_names, to: :country, interceptors: i[unpack_some unpack_seq array_no_nil]

  private

  attr_reader :country

  def array_no_nil(array)
    array.nil? ? [] : array
  end
end

#nationalityString (readonly)



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/country_codes/country.rb', line 18

class Country
  include Internal::Helpers

  # Wraps an instance of `io.wunderschild.country_codes.Country` to be used in Ruby.
  #
  # @note This code is not supposed to be used externally!
  # @param [JavaLangObject] java_country An instance of `io.wunderschild.country_codes.Country`
  def initialize(java_country)
    @country = java_country
  end

  delegate :alpha2, :alpha3, :official_name, to: :country
  delegate :nationality, :sovereignty, to: :country, interceptors: :unpack_some
  delegate :other_names, to: :country, interceptors: i[unpack_some unpack_seq array_no_nil]

  private

  attr_reader :country

  def array_no_nil(array)
    array.nil? ? [] : array
  end
end

#official_nameString (readonly)



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/country_codes/country.rb', line 18

class Country
  include Internal::Helpers

  # Wraps an instance of `io.wunderschild.country_codes.Country` to be used in Ruby.
  #
  # @note This code is not supposed to be used externally!
  # @param [JavaLangObject] java_country An instance of `io.wunderschild.country_codes.Country`
  def initialize(java_country)
    @country = java_country
  end

  delegate :alpha2, :alpha3, :official_name, to: :country
  delegate :nationality, :sovereignty, to: :country, interceptors: :unpack_some
  delegate :other_names, to: :country, interceptors: i[unpack_some unpack_seq array_no_nil]

  private

  attr_reader :country

  def array_no_nil(array)
    array.nil? ? [] : array
  end
end

#other_namesArray<String> (readonly)



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/country_codes/country.rb', line 18

class Country
  include Internal::Helpers

  # Wraps an instance of `io.wunderschild.country_codes.Country` to be used in Ruby.
  #
  # @note This code is not supposed to be used externally!
  # @param [JavaLangObject] java_country An instance of `io.wunderschild.country_codes.Country`
  def initialize(java_country)
    @country = java_country
  end

  delegate :alpha2, :alpha3, :official_name, to: :country
  delegate :nationality, :sovereignty, to: :country, interceptors: :unpack_some
  delegate :other_names, to: :country, interceptors: i[unpack_some unpack_seq array_no_nil]

  private

  attr_reader :country

  def array_no_nil(array)
    array.nil? ? [] : array
  end
end

#sovereigntyString? (readonly)



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/country_codes/country.rb', line 18

class Country
  include Internal::Helpers

  # Wraps an instance of `io.wunderschild.country_codes.Country` to be used in Ruby.
  #
  # @note This code is not supposed to be used externally!
  # @param [JavaLangObject] java_country An instance of `io.wunderschild.country_codes.Country`
  def initialize(java_country)
    @country = java_country
  end

  delegate :alpha2, :alpha3, :official_name, to: :country
  delegate :nationality, :sovereignty, to: :country, interceptors: :unpack_some
  delegate :other_names, to: :country, interceptors: i[unpack_some unpack_seq array_no_nil]

  private

  attr_reader :country

  def array_no_nil(array)
    array.nil? ? [] : array
  end
end