Module: Shogun::Normalizer

Defined in:
lib/shogun/normalizer.rb

Instance Method Summary collapse

Instance Method Details

#as_metaObject



13
14
15
16
17
18
19
20
21
# File 'lib/shogun/normalizer.rb', line 13

def as_meta
  .inject({}) do |hash, meta|
    if public_send(meta)
      hash.merge(meta => public_send(meta))
    else
      hash
    end
  end
end

#to_hashObject



3
4
5
6
7
8
9
10
11
# File 'lib/shogun/normalizer.rb', line 3

def to_hash
  attributes.inject({}) do |hash, attribute|
    if public_send(attribute)
      hash.merge(attribute => public_send(attribute))
    else
      hash
    end
  end
end