Module: AusPostAPI::Endpoint::ClassMethods

Defined in:
lib/aus_post_api/endpoint/attributes.rb

Instance Method Summary collapse

Instance Method Details

#optional_attributes(*args) ⇒ Object



34
35
36
37
38
39
40
41
# File 'lib/aus_post_api/endpoint/attributes.rb', line 34

def optional_attributes(*args)
  if args.empty?
    @optional_attributes || []
  else
    @optional_attributes = args
    self.send(:attr_accessor, *args)
  end
end

#required_attributes(*args) ⇒ Object



25
26
27
28
29
30
31
32
# File 'lib/aus_post_api/endpoint/attributes.rb', line 25

def required_attributes(*args)
  if args.empty?
    @required_attributes || []
  else
    @required_attributes = args
    self.send(:attr_accessor, *args)
  end
end