Skip to content

Instantly share code, notes, and snippets.

View marzapower's full-sized avatar
🐂

Daniele Di Bernardo marzapower

🐂
View GitHub Profile
@marzapower
marzapower / example.rb
Created November 30, 2021 20:46 — forked from lyoshenka/example.rb
Example of outputting YAML in Ruby using inline style (array is all on one line, not spread out with each element on its own line)
full_data = {
response: {body: StyledYAML.literal(DATA.read), status: 200},
person: StyledYAML.inline('name' => 'Steve', 'age' => 24),
array: StyledYAML.inline(%w[ apples bananas oranges ])
}
StyledYAML.dump full_data, $stdout
__END__
{