Module: GSquire
- Defined in:
- lib/gsquire/client.rb,
lib/gsquire/models.rb,
lib/gsquire/logging.rb,
lib/gsquire/version.rb,
lib/gsquire/accounts.rb,
lib/gsquire/application.rb,
lib/gsquire/models/task.rb,
lib/gsquire/accounts/tokens.rb,
lib/gsquire/models/tasklist.rb,
lib/gsquire/accounts/tasks_api_middleware.rb
Defined Under Namespace
Classes: Accounts, Application, Client, DummyLogger, Task, Tasklist
Constant Summary collapse
Class Method Summary collapse
Class Method Details
.resource(hash) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/gsquire/models.rb', line 13 def resource(hash) return nil unless hash.include? 'kind' unless RESOURCE_KINDS.include? hash['kind'] raise ArgumentError, "Unknown resource kind #{hash['kind'].inspect}" end RESOURCE_KINDS[hash['kind']].new(hash) end |