module Habuco::ClassMethods
Public Instance Methods
attribute(name, value = nil)
click to toggle source
# File lib/habuco.rb, line 9 def attribute(name, value = nil) ns = namespace_scope.dup attribute_definitions[name] = AttributeDefinition.new(name, value, ns) end
attribute_definitions()
click to toggle source
# File lib/habuco.rb, line 14 def attribute_definitions @attribute_definitions ||= {} end
build(context = {})
click to toggle source
# File lib/habuco.rb, line 36 def build(context = {}) new(context).build end
each_definitions()
click to toggle source
# File lib/habuco.rb, line 32 def each_definitions @each_definitions ||= {} end
each_with_index(coll, &block)
click to toggle source
# File lib/habuco.rb, line 28 def each_with_index(coll, &block) each_definitions[coll.hash] = EachDefinition.new(coll, block) end
namespace(name) { || ... }
click to toggle source
# File lib/habuco.rb, line 18 def namespace(name) namespace_scope.push(name) yield namespace_scope.pop end
namespace_scope()
click to toggle source
# File lib/habuco.rb, line 24 def namespace_scope @namespace_scope ||= [] end