Parent

Methods

Class/Module Index [+]

Quicksearch

RGen::MetamodelBuilder::Intermediate::Annotation

Attributes

details[R]
source[R]

Public Class Methods

new(hash) click to toggle source
# File lib/rgen/metamodel_builder/intermediate/annotation.rb, line 10
def initialize(hash)
  if hash[:source] || hash[:details]
    restKeys = hash.keys - [:source, :details]
    raise "Hash key #{restKeys.first} not allowed." unless restKeys.empty?
    raise "Details not provided, key :details is missing" unless hash[:details]
    raise "Details must be provided as a hash" unless hash[:details].is_a?(Hash)
    @details = hash[:details]
    @source = hash[:source]
  else
    raise "Details must be provided as a hash" unless hash.is_a?(Hash)
    @details = hash
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.