Module: Amiba::Source::ClassMethods
- Defined in:
- lib/amiba/source.rb
Instance Method Summary collapse
- #define_metadata_accessor(name) ⇒ Object
- #metadata_fields(*names) ⇒ Object
- #pluralized_name ⇒ Object
Instance Method Details
#define_metadata_accessor(name) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/amiba/source.rb', line 23 def (name) module_eval <<-STR def #{name} metadata[:#{name.to_s}] end def #{name}=(val) metadata[:#{name.to_s}] = val end STR end |
#metadata_fields(*names) ⇒ Object
13 14 15 16 17 |
# File 'lib/amiba/source.rb', line 13 def (*names) names.each do |name| (name) end end |
#pluralized_name ⇒ Object
19 20 21 |
# File 'lib/amiba/source.rb', line 19 def pluralized_name name.demodulize.tableize end |