Class: Boxxspring::Synchronization::Configuration
- Inherits:
-
Object
- Object
- Boxxspring::Synchronization::Configuration
- Includes:
- Singleton
- Defined in:
- lib/boxxspring/synchronization/configuration.rb
Class Method Summary collapse
Class Method Details
.field(field_name, options = {}) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/boxxspring/synchronization/configuration.rb', line 9 def self.field( field_name, = {} ) class_eval( "def #{field_name}( *arguments ); " + "@#{field_name} = arguments.first unless arguments.empty?; " + "@#{field_name} || " + ( [ :default ].blank? ? "nil" : ( [ :default ].is_a?( String ) ? "'#{options[ :default ]}'" : "#{options[ :default ]}" ) ) + ";" + "end", __FILE__, __LINE__ ) end |