Tipos de Datos

Aquí te dejamos el código utilizado en esta lección:

//TIPOS DE DATOS

//1) BASICOS:

RuleContext Basic {
    Rule rule {
        String varStr = "string"
        
        Integer varInt = 5
        
        Double varDou = 5.5
        
        Bool varBol = true
    }
}

//2) ESPECIALES:

RuleContext Especials {
    Rule rule {
        Filter filter = Filter(modelName: "Location")
        
        PageFetcher pageFetcher = PageFetcher(pageSize: 20, filter: filter)
        
        DateFormatter dateFormatter = DateFormatter(format: "DD/MM/YYYY")
        
        MediaFile mediaFile = broker.media.open()
        
        MediaCameraConfigure mediaCameraConfigure = MediaCameraConfigure()
        
        MediaGalleryConfigure mediaGalleryConfigure = MediaGalleryConfigure()
        
        Timer timer = Timer(delay: true)
    }
}

//3) Modelos/Experiencias:

RuleContext Models {
    Rule rule {
        Location location = Location()
        
        Marker marker = Marker()
        
        OAuth oauth = OAuth()
        
        ///
        
        Date date = Date()
    }
}

//4) Declaracion de variables:

RuleContext Vars {
    Rule rule {
        String strVar //correcto
        //String Integer //Incorrecto
        Integer strVar //Incorrecto
    }
}

> Siguiente