module AutotaskRuby::Fields

Converts Autotask Entity Fields into methods.

Public Instance Methods

field(method_name) click to toggle source
# File lib/autotask_ruby/fields.rb, line 6
def field(method_name)
  inst_variable_name = "@#{method_name}".to_sym
  define_method method_name do
    instance_variable_get inst_variable_name
  end
  define_method "#{method_name}=" do |new_value|
    instance_variable_set inst_variable_name, new_value
  end
end