README.md in netsuite-0.0.47 vs README.md in netsuite-0.0.48

- old
+ new

@@ -16,26 +16,44 @@ Or install it yourself as: $ gem install netsuite +This gem is built for ruby 1.9.x, checkout the [1-8-stable](https://github.com/RevolutionPrep/netsuite/tree/1-8-stable) branch for ruby 1.8.x support. ## Usage +### Configuration +```ruby +NetSuite.configure do + reset! + + api_version '2012_1' + + # specify full wsdl URL for sandbox / production switching + wsdl "https://webservices.sandbox.netsuite.com/wsdl/v#{api_version}_0/netsuite.wsdl" + + # login information + email 'email@domain.com' + password 'password' + account '12345' + role 1111 +end +``` + ### Customer * Initializing a customer can be done using a hash of attributes. -#### Get +### Get * Retrieves the customer by internalId. ```Ruby customer = NetSuite::Records::Customer.get(:internal_id => 4) # => #<NetSuite::Records::Customer:0x1042f59b8> customer.is_person # => true ``` -<a name='extending'> ## Additions * Please submit a pull request for any models or actions that you would like to be included. The API is quite large and so we will necessarily not cover all of it. * Records should go into the `lib/netsuite/records/` directory. * Actions should be placed in their respective subdirectory under `lib/netsuite/actions`. @@ -97,8 +115,20 @@ ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) -3. Commit your changes (`git commit -am 'Added some feature'`) -4. Push to the branch (`git push origin my-new-feature`) -5. Create new Pull Request +3. Write new test and ensure that `bundle exec rspec` doesn't fail +4. Commit your changes (`git commit -am 'Added some feature'`) +5. Push to the branch (`git push origin my-new-feature`) +6. Create new Pull Request + +## Fields and RecordRefs + +Note that some record attributes are specified as Fields while others are specified as RecordRefs. In some cases +attributes are actually RecordRefs in the schema, but we indicate them as Fields. Our experience has shown +this works as long as the attribute is only read from and is not written to. Writing a value for an attribute +that has been wrongly specified will result in an error. Be careful when initializing objects from other objects -- +they may carry attributes that write to the new object. + +As we build up this gem we will replace these inconsistent Fields with RecordRefs. Feel free to contribute new Record +definitions to help us along.