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
true
when compared values are the same objects. -
#==(other_val) ⇒ Boolean
Returns
true
when compared values are equal. -
#array? ⇒ Object
Returns
true
when value is a javascipt array. -
#ary? ⇒ Object
Returns
true
when value is a javascipt array. -
#bool? ⇒ Object
Returns
true
when value is a javascipt boolean. -
#boolean? ⇒ Object
Returns
true
when value is a javascipt boolean. -
#date? ⇒ Boolean
Returns
true
when value is a javascipt date. -
#empty? ⇒ Boolean
Returns
true
when value is empty. -
#external? ⇒ Boolean
Returns
true
when value is a v8 external value. -
#false? ⇒ Boolean
Returns
true
when value is a javascipt bool false. -
#func? ⇒ Object
Returns
true
when value is a javascipt function. -
#function? ⇒ Object
Returns
true
when value is a javascipt function. -
#int? ⇒ Object
Returns
true
when value is a javascipt integer. -
#integer? ⇒ Object
Returns
true
when value is a javascipt integer. -
#null? ⇒ Boolean
Returns
true
when value is a javascipt null. -
#num? ⇒ Object
Returns
true
when value is a javascipt floating point number. -
#number? ⇒ Object
Returns
true
when value is a javascipt floating point number. -
#obj? ⇒ Object
Returns
true
when value is a javascipt object. -
#object? ⇒ Object
Returns
true
when value is a javascipt object. -
#regex? ⇒ Object
Returns
true
when value is a javascipt regexp. -
#regexp? ⇒ Object
Returns
true
when value is a javascipt regexp. -
#str? ⇒ Object
Returns
true
when value is a javascipt string. -
#string? ⇒ Object
Returns
true
when 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
true
when value is a javascipt bool true. -
#undefined? ⇒ Boolean
Returns
true
when 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 28 29 30 31 |
# File 'ext/v8/v8_value.cpp', line 22
static VALUE rb_v8_value_new(VALUE self, VALUE data)
{
HandleScope scope;
if (data != Qtrue && data != Qfalse && data != Qnil) {
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.
308 309 310 311 312 |
# File 'ext/v8/v8_value.cpp', line 308
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.
321 322 323 324 325 |
# File 'ext/v8/v8_value.cpp', line 321
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.
124 125 126 127 128 |
# File 'ext/v8/v8_value.cpp', line 124
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.
124 125 126 127 128 |
# File 'ext/v8/v8_value.cpp', line 124
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.
138 139 140 141 142 |
# File 'ext/v8/v8_value.cpp', line 138
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.
138 139 140 141 142 |
# File 'ext/v8/v8_value.cpp', line 138
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.
165 166 167 168 169 |
# File 'ext/v8/v8_value.cpp', line 165
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.
204 205 206 207 208 |
# File 'ext/v8/v8_value.cpp', line 204
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.
96 97 98 99 100 |
# File 'ext/v8/v8_value.cpp', line 96
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.
191 192 193 194 195 |
# File 'ext/v8/v8_value.cpp', line 191
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.
110 111 112 113 114 |
# File 'ext/v8/v8_value.cpp', line 110
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.
110 111 112 113 114 |
# File 'ext/v8/v8_value.cpp', line 110
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.
55 56 57 58 59 |
# File 'ext/v8/v8_value.cpp', line 55
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.
55 56 57 58 59 |
# File 'ext/v8/v8_value.cpp', line 55
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.
217 218 219 220 221 |
# File 'ext/v8/v8_value.cpp', line 217
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.
69 70 71 72 73 |
# File 'ext/v8/v8_value.cpp', line 69
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.
69 70 71 72 73 |
# File 'ext/v8/v8_value.cpp', line 69
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.
41 42 43 44 45 |
# File 'ext/v8/v8_value.cpp', line 41
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.
41 42 43 44 45 |
# File 'ext/v8/v8_value.cpp', line 41
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.
152 153 154 155 156 |
# File 'ext/v8/v8_value.cpp', line 152
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.
152 153 154 155 156 |
# File 'ext/v8/v8_value.cpp', line 152
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.
83 84 85 86 87 |
# File 'ext/v8/v8_value.cpp', line 83
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.
83 84 85 86 87 |
# File 'ext/v8/v8_value.cpp', line 83
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.
282 283 284 285 286 |
# File 'ext/v8/v8_value.cpp', line 282
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.
256 257 258 259 260 |
# File 'ext/v8/v8_value.cpp', line 256
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.
269 270 271 272 273 |
# File 'ext/v8/v8_value.cpp', line 269
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.
295 296 297 298 299 |
# File 'ext/v8/v8_value.cpp', line 295
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.
243 244 245 246 247 |
# File 'ext/v8/v8_value.cpp', line 243
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.
178 179 180 181 182 |
# File 'ext/v8/v8_value.cpp', line 178
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.
230 231 232 233 234 |
# File 'ext/v8/v8_value.cpp', line 230
static VALUE rb_v8_value_undefined_p(VALUE self)
{
HandleScope scope;
return to_ruby(unwrap(self)->IsUndefined());
}
|