module Synced::AttributesAsHash

Public Instance Methods

synced_attributes_as_hash(attributes) click to toggle source

On a Hash returns the same Hash On an Array returns a Hash with identical corresponding keys and values Used for mapping local - remote attributes

# File lib/synced/attributes_as_hash.rb, line 6
def synced_attributes_as_hash(attributes)
  return attributes if attributes.is_a?(Hash)
  Hash[Array.wrap(attributes).map { |name| [name, name] }]
end