Class: Mustang::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.
Class Method Details
.V8::Value.new(obj) ⇒ Object
Returns new V8 value reflected from given object.
22 23 24 25 26 27 |
# File 'ext/v8/v8_value.cpp', line 22 static VALUE rb_v8_value_new(VALUE self, VALUE data) { HandleScope scope; PREVENT_CREATION_WITHOUT_CONTEXT(); return v8_ref_new(self, to_v8(data)); } |
Instance Method Details
#===(other_val) ⇒ Boolean
Returns true when compared values are the same objects.
304 305 306 307 308 |
# File 'ext/v8/v8_value.cpp', line 304 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.
317 318 319 320 321 |
# File 'ext/v8/v8_value.cpp', line 317 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.
120 121 122 123 124 |
# File 'ext/v8/v8_value.cpp', line 120 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.
120 121 122 123 124 |
# File 'ext/v8/v8_value.cpp', line 120 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.
134 135 136 137 138 |
# File 'ext/v8/v8_value.cpp', line 134 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.
134 135 136 137 138 |
# File 'ext/v8/v8_value.cpp', line 134 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.
161 162 163 164 165 |
# File 'ext/v8/v8_value.cpp', line 161 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.
200 201 202 203 204 |
# File 'ext/v8/v8_value.cpp', line 200 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.
92 93 94 95 96 |
# File 'ext/v8/v8_value.cpp', line 92 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.
187 188 189 190 191 |
# File 'ext/v8/v8_value.cpp', line 187 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.
106 107 108 109 110 |
# File 'ext/v8/v8_value.cpp', line 106 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.
106 107 108 109 110 |
# File 'ext/v8/v8_value.cpp', line 106 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.
51 52 53 54 55 |
# File 'ext/v8/v8_value.cpp', line 51 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.
51 52 53 54 55 |
# File 'ext/v8/v8_value.cpp', line 51 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.
213 214 215 216 217 |
# File 'ext/v8/v8_value.cpp', line 213 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.
65 66 67 68 69 |
# File 'ext/v8/v8_value.cpp', line 65 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.
65 66 67 68 69 |
# File 'ext/v8/v8_value.cpp', line 65 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.
37 38 39 40 41 |
# File 'ext/v8/v8_value.cpp', line 37 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.
37 38 39 40 41 |
# File 'ext/v8/v8_value.cpp', line 37 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.
148 149 150 151 152 |
# File 'ext/v8/v8_value.cpp', line 148 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.
148 149 150 151 152 |
# File 'ext/v8/v8_value.cpp', line 148 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.
79 80 81 82 83 |
# File 'ext/v8/v8_value.cpp', line 79 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.
79 80 81 82 83 |
# File 'ext/v8/v8_value.cpp', line 79 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.
278 279 280 281 282 |
# File 'ext/v8/v8_value.cpp', line 278 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.
252 253 254 255 256 |
# File 'ext/v8/v8_value.cpp', line 252 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.
265 266 267 268 269 |
# File 'ext/v8/v8_value.cpp', line 265 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.
291 292 293 294 295 |
# File 'ext/v8/v8_value.cpp', line 291 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.
239 240 241 242 243 |
# File 'ext/v8/v8_value.cpp', line 239 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.
174 175 176 177 178 |
# File 'ext/v8/v8_value.cpp', line 174 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.
226 227 228 229 230 |
# File 'ext/v8/v8_value.cpp', line 226 static VALUE rb_v8_value_undefined_p(VALUE self) { HandleScope scope; return to_ruby(unwrap(self)->IsUndefined()); } |