Class: SKApi::Resources::Address

Inherits:
Base show all
Defined in:
lib/resources/address.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize, set_connection

Methods included from Utils::Serializer

included

Methods inherited from ActiveResource::Base

#encode, instantiate_collection, #load_attributes_from_response

Constructor Details

This class inherits a constructor from SKApi::Resources::Base

Class Method Details

.schemaObject



9
10
11
12
# File 'lib/resources/address.rb', line 9

def self.schema
  { "type" => "object",
  "properties" => SKApi::Resources::Address.schema_props}
end

.schema_propsObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/resources/address.rb', line 14

def self.schema_props
  {
     "id"       => {"type" => "string", "identity" => true, "readonly" => true},
     "address1" => {"type" => "string", "optional" => true},
     "address2" => {"type" => "string", "optional" => true},
     "city"     => {"type" => "string"},
     "country"  => {"type" => "string", "optional" => true},
     "state"    => {"type" => "string", "optional" => true},
     "zip"      => {"type" => "string", "optional" => true},
     "pobox"    => {"type" => "string", "optional" => true},
     "long"     => {"type" => "string", "optional" => true},
     "lat"      => {"type" => "string", "optional" => true},
     "address_type" => {"type" => "string", "optional" => true},
     "created_at"   => {"type" => "string", "format" =>"date-time", "readonly"=> true},
     "updated_at"   => {"type" => "string", "format" =>"date-time", "readonly"=> true},

   }
end

Instance Method Details

#saveObject



5
6
7
# File 'lib/resources/address.rb', line 5

def save
  save_with_validation
end