Class: ComfyConf::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/comfy_conf/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pathname, &block) ⇒ Parser

Returns a new instance of Parser.



8
9
10
11
# File 'lib/comfy_conf/parser.rb', line 8

def initialize(pathname, &block)
  @pathname = Pathname.new(pathname)
  @definition = Definition.new('root', &block)
end

Instance Attribute Details

#definitionObject (readonly)

Returns the value of attribute definition.



12
13
14
# File 'lib/comfy_conf/parser.rb', line 12

def definition
  @definition
end

#pathnameObject (readonly)

Returns the value of attribute pathname.



12
13
14
# File 'lib/comfy_conf/parser.rb', line 12

def pathname
  @pathname
end

Instance Method Details

#dataObject



14
15
16
# File 'lib/comfy_conf/parser.rb', line 14

def data
  @data ||= Data.new(nil, definition, type_checked_config_data)
end