Class: V8::Value
Class Method Summary collapse
-
.V8::Value.new(obj) ⇒ Object
Returns new V8 value reflected from given object.
Instance Method Summary collapse
-
#===(other_val) ⇒ Boolean
Returns
truewhen compared values are the same objects. -
#==(other_val) ⇒ Boolean
Returns
truewhen compared values are equal. -
#array? ⇒ Object
Returns
truewhen value is a javascipt array. -
#ary? ⇒ Object
Returns
truewhen value is a javascipt array. -
#bool? ⇒ Object
Returns
truewhen value is a javascipt boolean. -
#boolean? ⇒ Object
Returns
truewhen value is a javascipt boolean. -
#date? ⇒ Boolean
Returns
truewhen value is a javascipt date. -
#empty? ⇒ Boolean
Returns
truewhen value is empty. -
#external? ⇒ Boolean
Returns
truewhen value is a v8 external value. -
#false? ⇒ Boolean
Returns
truewhen value is a javascipt bool false. -
#func? ⇒ Object
Returns
truewhen value is a javascipt function. -
#function? ⇒ Object
Returns
truewhen value is a javascipt function. -
#int? ⇒ Object
Returns
truewhen value is a javascipt integer. -
#integer? ⇒ Object
Returns
truewhen value is a javascipt integer. -
#null? ⇒ Boolean
Returns
truewhen value is a javascipt null. -
#num? ⇒ Object
Returns
truewhen value is a javascipt floating point number. -
#number? ⇒ Object
Returns
truewhen value is a javascipt floating point number. -
#obj? ⇒ Object
Returns
truewhen value is a javascipt object. -
#object? ⇒ Object
Returns
truewhen value is a javascipt object. -
#regex? ⇒ Object
Returns
truewhen value is a javascipt regexp. -
#regexp? ⇒ Object
Returns
truewhen value is a javascipt regexp. -
#str? ⇒ Object
Returns
truewhen value is a javascipt string. -
#string? ⇒ Object
Returns
truewhen value is a javascipt string. -
#to_boolean ⇒ Boolean
Returns bool representation of this value.
-
#to_integer ⇒ Integer
Returns integer representation of this value.
-
#to_number ⇒ Numeric
Returns number representation of this value.
-
#to_object ⇒ Object
Returns object representation of this value.
-
#to_string ⇒ String
Returns string representation of this value.
-
#true? ⇒ Boolean
Returns
truewhen value is a javascipt bool true. -
#undefined? ⇒ Boolean
Returns
truewhen value is undefined.
Methods inherited from Data
Class Method Details
.V8::Value.new(obj) ⇒ Object
Returns new V8 value reflected from given object.
22 23 24 25 |
# File 'ext/v8/v8_value.cpp', line 22 static VALUE rb_v8_value_new(VALUE self, VALUE data) { return v8_ref_new(self, to_v8(data)); } |
Instance Method Details
#===(other_val) ⇒ Boolean
Returns true when compared values are the same objects.
302 303 304 305 306 |
# File 'ext/v8/v8_value.cpp', line 302 static VALUE rb_v8_value_equals(VALUE self, VALUE value) { HandleScope scope; return to_ruby(unwrap(self)->Equals(to_v8(value))); } |
#==(other_val) ⇒ Boolean
Returns true when compared values are equal.
315 316 317 318 319 |
# File 'ext/v8/v8_value.cpp', line 315 static VALUE rb_v8_value_strict_equals(VALUE self, VALUE value) { HandleScope scope; return to_ruby(unwrap(self)->StrictEquals(to_v8(value))); } |
#array? ⇒ Boolean #ary? ⇒ Boolean
Returns true when value is a javascipt array.
118 119 120 121 122 |
# File 'ext/v8/v8_value.cpp', line 118 static VALUE rb_v8_value_array_p(VALUE self) { HandleScope scope; return to_ruby(unwrap(self)->IsArray()); } |
#array? ⇒ Boolean #ary? ⇒ Boolean
Returns true when value is a javascipt array.
118 119 120 121 122 |
# File 'ext/v8/v8_value.cpp', line 118 static VALUE rb_v8_value_array_p(VALUE self) { HandleScope scope; return to_ruby(unwrap(self)->IsArray()); } |
#boolean? ⇒ Boolean #bool? ⇒ Boolean
Returns true when value is a javascipt boolean.
132 133 134 135 136 |
# File 'ext/v8/v8_value.cpp', line 132 static VALUE rb_v8_value_boolean_p(VALUE self) { HandleScope scope; return to_ruby(unwrap(self)->IsBoolean()); } |
#boolean? ⇒ Boolean #bool? ⇒ Boolean
Returns true when value is a javascipt boolean.
132 133 134 135 136 |
# File 'ext/v8/v8_value.cpp', line 132 static VALUE rb_v8_value_boolean_p(VALUE self) { HandleScope scope; return to_ruby(unwrap(self)->IsBoolean()); } |
#date? ⇒ Boolean
Returns true when value is a javascipt date.
159 160 161 162 163 |
# File 'ext/v8/v8_value.cpp', line 159 static VALUE rb_v8_value_date_p(VALUE self) { HandleScope scope; return to_ruby(unwrap(self)->IsDate()); } |
#empty? ⇒ Boolean
Returns true when value is empty.
198 199 200 201 202 |
# File 'ext/v8/v8_value.cpp', line 198 static VALUE rb_v8_value_empty_p(VALUE self) { HandleScope scope; return to_ruby(unwrap(self).IsEmpty()); } |
#external? ⇒ Boolean
Returns true when value is a v8 external value.
90 91 92 93 94 |
# File 'ext/v8/v8_value.cpp', line 90 static VALUE rb_v8_value_external_p(VALUE self) { HandleScope scope; return to_ruby(unwrap(self)->IsExternal()); } |
#false? ⇒ Boolean
Returns true when value is a javascipt bool false.
185 186 187 188 189 |
# File 'ext/v8/v8_value.cpp', line 185 static VALUE rb_v8_value_false_p(VALUE self) { HandleScope scope; return to_ruby(unwrap(self)->IsFalse()); } |
#function? ⇒ Boolean #func? ⇒ Boolean
Returns true when value is a javascipt function.
104 105 106 107 108 |
# File 'ext/v8/v8_value.cpp', line 104 static VALUE rb_v8_value_function_p(VALUE self) { HandleScope scope; return to_ruby(unwrap(self)->IsFunction()); } |
#function? ⇒ Boolean #func? ⇒ Boolean
Returns true when value is a javascipt function.
104 105 106 107 108 |
# File 'ext/v8/v8_value.cpp', line 104 static VALUE rb_v8_value_function_p(VALUE self) { HandleScope scope; return to_ruby(unwrap(self)->IsFunction()); } |
#integer? ⇒ Boolean #int? ⇒ Boolean
Returns true when value is a javascipt integer.
49 50 51 52 53 |
# File 'ext/v8/v8_value.cpp', line 49 static VALUE rb_v8_value_integer_p(VALUE self) { HandleScope scope; return to_ruby(unwrap(self)->IsInt32() || unwrap(self)->IsUint32()); } |
#integer? ⇒ Boolean #int? ⇒ Boolean
Returns true when value is a javascipt integer.
49 50 51 52 53 |
# File 'ext/v8/v8_value.cpp', line 49 static VALUE rb_v8_value_integer_p(VALUE self) { HandleScope scope; return to_ruby(unwrap(self)->IsInt32() || unwrap(self)->IsUint32()); } |
#null? ⇒ Boolean
Returns true when value is a javascipt null.
211 212 213 214 215 |
# File 'ext/v8/v8_value.cpp', line 211 static VALUE rb_v8_value_null_p(VALUE self) { HandleScope scope; return to_ruby(unwrap(self)->IsNull()); } |
#number? ⇒ Boolean #num? ⇒ Boolean
Returns true when value is a javascipt floating point number.
63 64 65 66 67 |
# File 'ext/v8/v8_value.cpp', line 63 static VALUE rb_v8_value_number_p(VALUE self) { HandleScope scope; return to_ruby(unwrap(self)->IsNumber()); } |
#number? ⇒ Boolean #num? ⇒ Boolean
Returns true when value is a javascipt floating point number.
63 64 65 66 67 |
# File 'ext/v8/v8_value.cpp', line 63 static VALUE rb_v8_value_number_p(VALUE self) { HandleScope scope; return to_ruby(unwrap(self)->IsNumber()); } |
#object? ⇒ Boolean #obj? ⇒ Boolean
Returns true when value is a javascipt object.
35 36 37 38 39 |
# File 'ext/v8/v8_value.cpp', line 35 static VALUE rb_v8_value_object_p(VALUE self) { HandleScope scope; return to_ruby(unwrap(self)->IsObject()); } |
#object? ⇒ Boolean #obj? ⇒ Boolean
Returns true when value is a javascipt object.
35 36 37 38 39 |
# File 'ext/v8/v8_value.cpp', line 35 static VALUE rb_v8_value_object_p(VALUE self) { HandleScope scope; return to_ruby(unwrap(self)->IsObject()); } |
#regexp? ⇒ Boolean #regex? ⇒ Boolean
Returns true when value is a javascipt regexp.
146 147 148 149 150 |
# File 'ext/v8/v8_value.cpp', line 146 static VALUE rb_v8_value_regexp_p(VALUE self) { HandleScope scope; return to_ruby(unwrap(self)->IsRegExp()); } |
#regexp? ⇒ Boolean #regex? ⇒ Boolean
Returns true when value is a javascipt regexp.
146 147 148 149 150 |
# File 'ext/v8/v8_value.cpp', line 146 static VALUE rb_v8_value_regexp_p(VALUE self) { HandleScope scope; return to_ruby(unwrap(self)->IsRegExp()); } |
#string? ⇒ Boolean #str? ⇒ Boolean
Returns true when value is a javascipt string.
77 78 79 80 81 |
# File 'ext/v8/v8_value.cpp', line 77 static VALUE rb_v8_value_string_p(VALUE self) { HandleScope scope; return to_ruby(unwrap(self)->IsString()); } |
#string? ⇒ Boolean #str? ⇒ Boolean
Returns true when value is a javascipt string.
77 78 79 80 81 |
# File 'ext/v8/v8_value.cpp', line 77 static VALUE rb_v8_value_string_p(VALUE self) { HandleScope scope; return to_ruby(unwrap(self)->IsString()); } |
#to_boolean ⇒ Boolean
Returns bool representation of this value.
276 277 278 279 280 |
# File 'ext/v8/v8_value.cpp', line 276 static VALUE rb_v8_value_to_boolean(VALUE self) { HandleScope scope; return to_ruby(unwrap(self)->ToBoolean()); } |
#to_integer ⇒ Integer
Returns integer representation of this value.
250 251 252 253 254 |
# File 'ext/v8/v8_value.cpp', line 250 static VALUE rb_v8_value_to_integer(VALUE self) { HandleScope scope; return to_ruby(unwrap(self)->ToInteger()); } |
#to_number ⇒ Numeric
Returns number representation of this value.
263 264 265 266 267 |
# File 'ext/v8/v8_value.cpp', line 263 static VALUE rb_v8_value_to_number(VALUE self) { HandleScope scope; return to_ruby(unwrap(self)->ToNumber()); } |
#to_object ⇒ Object
Returns object representation of this value.
289 290 291 292 293 |
# File 'ext/v8/v8_value.cpp', line 289 static VALUE rb_v8_value_to_object(VALUE self) { HandleScope scope; return to_ruby(unwrap(self)->ToObject()); } |
#to_string ⇒ String
Returns string representation of this value.
237 238 239 240 241 |
# File 'ext/v8/v8_value.cpp', line 237 static VALUE rb_v8_value_to_string(VALUE self) { HandleScope scope; return to_ruby(unwrap(self)->ToString()); } |
#true? ⇒ Boolean
Returns true when value is a javascipt bool true.
172 173 174 175 176 |
# File 'ext/v8/v8_value.cpp', line 172 static VALUE rb_v8_value_true_p(VALUE self) { HandleScope scope; return to_ruby(unwrap(self)->IsTrue()); } |
#undefined? ⇒ Boolean
Returns true when value is undefined.
224 225 226 227 228 |
# File 'ext/v8/v8_value.cpp', line 224 static VALUE rb_v8_value_undefined_p(VALUE self) { HandleScope scope; return to_ruby(unwrap(self)->IsUndefined()); } |