Module: Panda::Builders::ClassMethods
- Included in:
- Proxy
- Defined in:
- lib/panda/modules/builders.rb
Instance Method Summary collapse
- #create(attributes = {}) {|resource| ... } ⇒ Object
- #create!(attributes = {}) {|resource| ... } ⇒ Object
Instance Method Details
#create(attributes = {}) {|resource| ... } ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/panda/modules/builders.rb', line 10 def create(attributes={}) resource = build_resource(attributes) yield resource if block_given? resource.create resource end |
#create!(attributes = {}) {|resource| ... } ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/panda/modules/builders.rb', line 18 def create!(attributes={}) resource = build_resource(attributes) yield resource if block_given? resource.create! resource end |