module JSObjectUtils

Overview

This module provides common operations that every JavaScript entity can do

Direct including types

Defined in:

components/js_object_utils.cr

Instance Method Summary

Instance Method Detail

def [](name : String) #

Gets property name


[View source]
def [](index : UInt32) #

Gets value at index index


[View source]
def []=(name : String, value) #

Set property name


[View source]
def []=(index : UInt32, value) #

Set a value at index index


[View source]
def delete(name : String) #

Deletes property name of the object


[View source]
def is_array? #

Perform type checking


[View source]
def is_bool? #

Perform type checking


[View source]
def is_instance_of?(class_name : String) #

JavaScript's instanceof operator


[View source]
def is_null? #

Perform type checking


[View source]
def is_number? #

Perform type checking


[View source]
def is_string? #

Perform type checking


[View source]
def is_undefined? #

Perform type checking


[View source]
def to_b #

Converts JavaScript value to Crystal's Bool


[View source]
def to_f64 #

Converts JavaScript value to Crystal's Float64


[View source]
def to_i32 #

Converts JavaScript value to Crystal's Int32


[View source]
def to_s #

Converts JavaScript value to Crystal's String


[View source]