Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Severs committed Jun 5, 2017
1 parent 6e1d88f commit d732479
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,22 @@ requests with an access token.
```ruby
# Fetch a location
id = '6fdf0530-3e4e-46f1-9d11-5f90c48a50dc'
location = FrederickAPI::V2::Location.find(id)
=> #<FrederickAPI::V2::Location:0x007fd2f29a7618>

location.name
=> 'Bizzy Biz'

# Update a location
location.name = 'Biz Bizziest'
location.save
=> true

# To instantiate a resource for update without fetching it first, set an id
location = FrederickAPI::V2::Location.new(id: id)
location.update_attributes(phone_number: '(555) 555-5555')
=> true
access_token = '9jsdo320fjfkfdksls30dfdcd919bcaa1b7804dbbebda0'
FrederickAPI::V2::Location.with_access_token(access_token) do
location = FrederickAPI::V2::Location.find(id)
# => #<FrederickAPI::V2::Location:0x007fd2f29a7618>

location.name
# => 'Bizzy Biz'

# Update a location
location.name = 'Biz Bizziest'
location.save
# => true

# To instantiate a resource for update without fetching it first, set an id
location = FrederickAPI::V2::Location.new(id: id)
location.update_attributes(phone_number: '(555) 555-5555')
# => true
end
```

0 comments on commit d732479

Please sign in to comment.