Class: MetaContent::Dsl

Inherits:
Object
  • Object
show all
Defined in:
lib/meta_content/dsl.rb

Instance Method Summary collapse

Constructor Details

#initialize(klass, namespace) ⇒ Dsl

Returns a new instance of Dsl.



4
5
6
7
# File 'lib/meta_content/dsl.rb', line 4

def initialize(klass, namespace)
  @klass = klass
  @namespace = namespace
end

Instance Method Details

#field(*fields) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/meta_content/dsl.rb', line 21

def field(*fields)
  options = fields.extract_options!
  options[:namespace] = @namespace
  fields.each do |field|
    create_accessors_for_meta_field(field, options)
  end
end