Class: VertxRedis::Script

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

Overview

Container for a script and its sha1 hash.

Constant Summary

@@j_api_type =
Object.new

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)

17
18
19
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-redis/script.rb', line 17

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

+ (::VertxRedis::Script) create(script = nil, sha1 = nil)

Parameters:

  • script (String) (defaults to: nil)
  • sha1 (String) (defaults to: nil)

Returns:

Raises:

  • (ArgumentError)

35
36
37
38
39
40
41
42
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-redis/script.rb', line 35

def self.create(script=nil,sha1=nil)
  if script.class == String && !block_given? && sha1 == nil
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxRedis::Script.java_method(:create, [Java::java.lang.String.java_class]).call(script),::VertxRedis::Script)
  elsif script.class == String && sha1.class == String && !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxRedis::Script.java_method(:create, [Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(script,sha1),::VertxRedis::Script)
  end
  raise ArgumentError, "Invalid arguments when calling create(#{script},#{sha1})"
end

+ (Object) j_api_type


26
27
28
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-redis/script.rb', line 26

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class


29
30
31
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-redis/script.rb', line 29

def self.j_class
  Java::IoVertxRedis::Script.java_class
end

+ (Object) unwrap(obj)


23
24
25
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-redis/script.rb', line 23

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

+ (Object) wrap(obj)


20
21
22
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-redis/script.rb', line 20

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

Instance Method Details

- (String) get_script

Returns:

  • (String)

Raises:

  • (ArgumentError)

44
45
46
47
48
49
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-redis/script.rb', line 44

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

- (String) get_sha1

Returns:

  • (String)

Raises:

  • (ArgumentError)

51
52
53
54
55
56
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-redis/script.rb', line 51

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