class Defaulty::Domain

Attributes

name[R]
properties[R]

Public Class Methods

new(h) click to toggle source
# File lib/defaulty.rb, line 26
def initialize(h)
  raise "Domain needs to be initialized with a hash containing one key, the domain name" unless h.size == 1

  @name, data = h.first
  properties = data.delete('keys').map { |key, data| Property.new(key, data) } 
  @properties = Hash[ properties.map { |property| [property.name, property] } ]
end