Skip to content
This repository has been archived by the owner on Jun 23, 2020. It is now read-only.

Commit

Permalink
renamed #type to #resource_type, some resources specify a type field
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Stachl committed Mar 4, 2014
1 parent 4a70074 commit 23f98bf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion desk_api.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Gem::Specification.new do |gem|
gem.add_runtime_dependency('simple_oauth', '~> 0.1')
gem.add_runtime_dependency('addressable', '~> 2.3')

gem.add_development_dependency('rake', '~> 0.9')
gem.add_development_dependency('rake', '~> 10.1.1')
gem.add_development_dependency('rspec', '~> 2.6')
gem.add_development_dependency('vcr', '~> 2.0')
gem.add_development_dependency('simplecov', '~> 0.7')
Expand Down
2 changes: 1 addition & 1 deletion lib/desk_api/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def href=(value)
@_definition['_links']['self']['href'] = value
end

def type
def resource_type
get_self['class']
end

Expand Down
4 changes: 2 additions & 2 deletions spec/desk_api/resource_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@
end
end

context '#type' do
context '#resource_type' do
it 'returns the resources type' do
res = DeskApi::Resource.new(subject, {
'_links'=>{'self'=>{'href'=>'/api/v2/cases','class'=>'page'}}
}, true)
res.type.should eq('page')
res.resource_type.should eq('page')
end
end

Expand Down

0 comments on commit 23f98bf

Please sign in to comment.