Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
imalsogreg committed Oct 23, 2024
1 parent aa31f42 commit 316ac5f
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions engine/language_client_ruby/ext/ruby_ffi/src/ruby_to_json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,9 @@ impl<'rb> RubyToJson<'rb> {
serde_magnus::serialize(&json)
}

pub fn type_name_for_checks(checks: &Vec<ResponseCheck>) -> String {
// let mut name = "Checks".to_string();
// let mut names: Vec<&String> = checks.iter().map(|ResponseCheck{name, ..}| name).collect();
// names.sort();
// for check_name in names.iter() {
// name.push_str("__");
// name.push_str(check_name);
// }
// name
"String".to_string()
}

/// Serialize a list of check results into some `Checked__*` instance.
pub fn serialize_response_checks(ruby: &Ruby, checks: &Vec<ResponseCheck>) -> crate::Result<RHash> {

// let class_name = format!("Types::{}", Self::type_name_for_checks(checks));
let class_name = Self::type_name_for_checks(checks);
let checks_class = ruby.eval::<RClass>(&class_name)?;

// Create a `Check` for each check in the `Checked__*`.
let hash = ruby.hash_new();
Expand All @@ -60,7 +45,6 @@ impl<'rb> RubyToJson<'rb> {
})?;

Ok(hash.into())
// checks_class.funcall("new", (hash,))
}

pub fn serialize_baml(ruby: &Ruby, types: RModule, mut from: BamlValueWithMeta<Vec<ResponseCheck>>) -> crate::Result<Value> {
Expand Down

0 comments on commit 316ac5f

Please sign in to comment.