Module: Promiscuous::Publisher::Model::Ephemeral::PromiscuousMethodsEphemeral

Included in:
PromiscuousMethods
Defined in:
lib/promiscuous/publisher/model/ephemeral.rb

Instance Method Summary collapse

Instance Method Details

#attribute(attr) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/promiscuous/publisher/model/ephemeral.rb', line 8

def attribute(attr)
  value = super
  if value.is_a?(Array) &&
     value.first.is_a?(Promiscuous::Publisher::Model::Ephemeral)
    value = {:types => ['Promiscuous::EmbeddedDocs'],
             :attributes => value.map(&:promiscuous).map(&:payload)}
  end
  value
end