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 d732479 commit cdbd93b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,12 @@ filter, sort, and include relationships.
An access token is required to access resources on behalf of a use. Use `Resource.with_access_token { ... }` to make
requests with an access token.


```ruby
# Fetch a location
id = '6fdf0530-3e4e-46f1-9d11-5f90c48a50dc'
location_id = '6fdf0530-3e4e-46f1-9d11-5f90c48a50dc'
access_token = '9jsdo320fjfkfdksls30dfdcd919bcaa1b7804dbbebda0'
FrederickAPI::V2::Location.with_access_token(access_token) do
location = FrederickAPI::V2::Location.find(id)
# Fetch a location
location = FrederickAPI::V2::Location.find(location_id)
# => #<FrederickAPI::V2::Location:0x007fd2f29a7618>

location.name
Expand All @@ -80,7 +79,7 @@ FrederickAPI::V2::Location.with_access_token(access_token) do
# => true

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

0 comments on commit cdbd93b

Please sign in to comment.