Class: VertxWeb::Locale

Inherits:
Object
  • Object
show all
Defined in:
/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/locale.rb

Direct Known Subclasses

LanguageHeader

Constant Summary

@@j_api_type =
Object.new

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)


16
17
18
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/locale.rb', line 16

def @@j_api_type.accept?(obj)
  obj.class == Locale
end

+ (::VertxWeb::Locale) create(language = nil, country = nil, variant = nil)

Parameters:

  • language (String) (defaults to: nil)
  • country (String) (defaults to: nil)
  • variant (String) (defaults to: nil)

Returns:

Raises:

  • (ArgumentError)


35
36
37
38
39
40
41
42
43
44
45
46
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/locale.rb', line 35

def self.create(language=nil,country=nil,variant=nil)
  if !block_given? && language == nil && country == nil && variant == nil
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWeb::Locale.java_method(:create, []).call(),::VertxWeb::Locale)
  elsif language.class == String && !block_given? && country == nil && variant == nil
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWeb::Locale.java_method(:create, [Java::java.lang.String.java_class]).call(language),::VertxWeb::Locale)
  elsif language.class == String && country.class == String && !block_given? && variant == nil
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWeb::Locale.java_method(:create, [Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(language,country),::VertxWeb::Locale)
  elsif language.class == String && country.class == String && variant.class == String && !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWeb::Locale.java_method(:create, [Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(language,country,variant),::VertxWeb::Locale)
  end
  raise ArgumentError, "Invalid arguments when calling create(#{language},#{country},#{variant})"
end

+ (Object) j_api_type



25
26
27
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/locale.rb', line 25

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



28
29
30
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/locale.rb', line 28

def self.j_class
  Java::IoVertxExtWeb::Locale.java_class
end

+ (Object) unwrap(obj)



22
23
24
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/locale.rb', line 22

def @@j_api_type.unwrap(obj)
  obj.j_del
end

+ (Object) wrap(obj)



19
20
21
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/locale.rb', line 19

def @@j_api_type.wrap(obj)
  Locale.new(obj)
end

Instance Method Details

- (String) country

Returns the country as reported by the HTTP client.

Returns:

  • (String)
    variant

Raises:

  • (ArgumentError)


57
58
59
60
61
62
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/locale.rb', line 57

def country
  if !block_given?
    return @j_del.java_method(:country, []).call()
  end
  raise ArgumentError, "Invalid arguments when calling country()"
end

- (String) language

Returns the language as reported by the HTTP client.

Returns:

  • (String)
    language

Raises:

  • (ArgumentError)


49
50
51
52
53
54
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/locale.rb', line 49

def language
  if !block_given?
    return @j_del.java_method(:language, []).call()
  end
  raise ArgumentError, "Invalid arguments when calling language()"
end

- (String) variant

Returns the variant as reported by the HTTP client.

Returns:

  • (String)
    variant

Raises:

  • (ArgumentError)


65
66
67
68
69
70
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/locale.rb', line 65

def variant
  if !block_given?
    return @j_del.java_method(:variant, []).call()
  end
  raise ArgumentError, "Invalid arguments when calling variant()"
end