Class: Staticpress::Metadata

Inherits:
JSObject
  • Object
show all
Defined in:
lib/staticpress/metadata.rb

Instance Method Summary collapse

Methods inherited from JSObject

#-, #[], #merge, new, #to_hash

Instance Method Details

#<<(other) ⇒ Object



3
4
5
# File 'lib/staticpress/metadata.rb', line 3

def <<(other)
  self
end

#inspectObject Also known as: to_s



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/staticpress/metadata.rb', line 7

def inspect
  details = to_hash.sort.map do |key, value|
    "#{key}=#{value.inspect}"
  end.join(', ')

  parts = [
    self.class,
    (details unless details.empty?)
  ].compact

  "#<#{parts.join(' ')}>"
end