Module: DaisybillApi::Ext::Links::ClassMethods
- Defined in:
- lib/daisybill_api/ext/links.rb
Instance Method Summary collapse
Instance Method Details
#link(name, options = {}) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/daisybill_api/ext/links.rb', line 8 def link(name, = {}) clazz = modulize [:class] links[name] = l = Link.new name, clazz, attribute l.foreign_key, :integer if l.foreign_key? define_method(name) { read_link(name).value } end |
#links ⇒ Object
15 16 17 |
# File 'lib/daisybill_api/ext/links.rb', line 15 def links @links ||= {} end |