Class: Naplug::Meta

Inherits:
Object
  • Object
show all
Defined in:
lib/naplug/meta.rb

Constant Summary collapse

DEFAULT =
{ :debug => false, :state => true, :description => '', :parent => nil, :benchmark => nil, :meta => true }
OPTIONS =
DEFAULT.keys

Instance Method Summary collapse

Constructor Details

#initialize(meta = DEFAULT) ⇒ Meta

Returns a new instance of Meta.



10
11
12
13
14
# File 'lib/naplug/meta.rb', line 10

def initialize(meta = DEFAULT)
  validate meta
  @meta = DEFAULT.merge meta
  @meta[:benchmark] = Benchmark::Tms.new if @meta[:benchmark]
end

Instance Method Details

#to_hObject



25
26
27
# File 'lib/naplug/meta.rb', line 25

def to_h
  @meta
end