module Lurker::Json::Tuple::InstanceMethods
Public Instance Methods
exists?(schema)
click to toggle source
# File lib/lurker/json/schema/tuple.rb, line 16 def exists?(schema) @schema[tuple_key].any? { |schm| schm.eql?(schema) } end
merge!(schema)
click to toggle source
# File lib/lurker/json/schema/tuple.rb, line 5 def merge!(schema) return if exists?(schema) @schema[tuple_key] << @parser.typed.parse_property( parent_property, schema) end
replace!(schema)
click to toggle source
# File lib/lurker/json/schema/tuple.rb, line 12 def replace!(schema) raise NotImplementedError end
Private Instance Methods
initialize_properties()
click to toggle source
# File lib/lurker/json/schema/tuple.rb, line 32 def initialize_properties @schema[tuple_key] ||= [] end
parse_schema(schema)
click to toggle source
# File lib/lurker/json/schema/tuple.rb, line 22 def parse_schema(schema) @schema = {} initialize_properties schema = schema.dup @schema[tuple_key] = (schema.delete(tuple_key) || schema).map do |payload| @parser.typed.parse_property(parent_property, payload) end end