Module: Magnetic
- Defined in:
- lib/magnetic/field.rb,
lib/magnetic/interface.rb
Defined Under Namespace
Modules: Field Classes: Interface, Path
Class Method Summary collapse
Class Method Details
.field(*argv, &block) ⇒ Object
213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
# File 'lib/magnetic/field.rb', line 213 def self.field *argv, &block name = argv.delete_first{|arg| String === arg or Symbol === arg } base = argv.delete_first{|arg| Field::Base.class === arg} configure = argv.delete_first{|arg| ['configure', :configure].include? arg} = argv.delete_first{|arg| Hash === arg} ||= {} . base ||= Field::Base field = base.clone field.name = name field.owner = self field.configure , &block field end |