Module: DaisybillApi::Ext::Links::ClassMethods

Defined in:
lib/daisybill_api/ext/links.rb

Instance Method Summary collapse

Instance Method Details



8
9
10
11
12
13
# File 'lib/daisybill_api/ext/links.rb', line 8

def link(name, options = {})
  clazz = modulize options[:class]
  links[name] = l = Link.new name, clazz, options
  attribute l.foreign_key, :integer if l.foreign_key?
  define_method(name) { read_link(name).value }
end


15
16
17
# File 'lib/daisybill_api/ext/links.rb', line 15

def links
  @links ||= {}
end