module ThreeScale::Core::APIClient::Attributes::ClassMethods

Constants

TIME_ATTRIBUTES

Public Instance Methods

attributes(*attributes) click to toggle source
# File lib/3scale/core/api_client/attributes.rb, line 40
def attributes(*attributes)
  return @attributes if attributes.empty?
  attributes.each do |attr|
    attr_reader attr
    define_method "#{attr}=" do |val|
      self.dirty = true
      val = Time.parse(val) if TIME_ATTRIBUTES.include? attr.to_sym
      instance_variable_set "@#{attr}", val
    end
  end
  @attributes = attributes
end