Class: ActiveTriples::Configuration::MergeItem

Inherits:
Item
  • Object
show all
Defined in:
lib/active_triples/configuration/merge_item.rb

Overview

Configuration item which sets a value by turning the original into an array and appending the given value to it.

This enables multiple types to be set on an object, for example.

Instance Attribute Summary

Attributes inherited from Item

#key, #object

Instance Method Summary collapse

Methods inherited from Item

#initialize, #value

Constructor Details

This class inherits a constructor from ActiveTriples::Configuration::Item

Instance Method Details

#set(value) ⇒ Object



11
12
13
14
# File 'lib/active_triples/configuration/merge_item.rb', line 11

def set(value)
  object.inner_hash[key] = Array.wrap(object.inner_hash[key])
  object.inner_hash[key] |= Array.wrap(value)
end