Class: RedSnow::Metadata

Inherits:
KeyValueCollection show all
Defined in:
lib/redsnow/blueprint.rb

Overview

Metadata collection Blueprint AST node

represents 'metadata section'

Instance Attribute Summary

Attributes inherited from KeyValueCollection

#collection

Instance Method Summary collapse

Methods inherited from KeyValueCollection

#[], #filter_collection

Constructor Details

#initialize(metadata) ⇒ Metadata

Returns a new instance of Metadata.

Parameters:

  • metadata (json)


91
92
93
94
95
96
97
98
# File 'lib/redsnow/blueprint.rb', line 91

def initialize()
  return if .nil?

  @collection = []
  .each do |item|
    @collection << Hash[name: item['name'], value: item.fetch('value', nil)]
  end
end