new_mutable_object

Function new_mutable_object 

Source
pub fn new_mutable_object(map: HashMap<String, Value>) -> Value
Expand description

Create new mutable object from HashMap

§Complexity

Cyclomatic complexity: 2

§Examples

use ruchy::runtime::object_helpers;
use ruchy::runtime::interpreter::Value;
use std::collections::HashMap;

let mut map = HashMap::new();
map.insert("x".to_string(), Value::Integer(10));
let obj = object_helpers::new_mutable_object(map);

assert!(object_helpers::is_mutable_object(&obj));