Module: Panda::Builders::CreateBuilder
- Included in:
- Proxy
- Defined in:
- lib/panda/modules/builders.rb
Instance Method Summary collapse
Instance Method Details
#create(attributes) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/panda/modules/builders.rb', line 11 def create(attributes) if attr_id=(attributes[:id] || attributes['id']) raise "Can't create attribute. Already have an id=#{attr_id}" end response = connection.post(full_object_url(many_path), attributes) Panda::const_get("#{end_class_name}").new(response) end |
#create!(attributes) ⇒ Object
20 21 22 |
# File 'lib/panda/modules/builders.rb', line 20 def create!(attributes) create(attributes) || raise(self.error.first.to_s) end |