Sha256: 7a2765a95acc478982ff9e68a32f48c2c1e4147580985a0c784af373163e629e

Contents?: true

Size: 404 Bytes

Versions: 1

Compression:

Stored size: 404 Bytes

Contents

module Trumpet
  class User
    @@attributes = [:name]
    attr_reader *@@attributes
    
    def self.create(options)
      attributes = post('/users', options)
      User.new(attributes)
    end
    
    def self.find(name)
      attributes = get("/users/#{name}")
      User.new(attributes) if attributes["name"]
    end
    
    def delete
      self.class.delete("/users/#{@name}")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
trumpet-trumpet-0.0.1 lib/trumpet/user.rb