Method: URI::PlateID.create

Defined in:
lib/uri/plate_id.rb

.create(model) ⇒ Object

Shorthand to build a URI::PlateID from a model.

URI::PlateID.create(Ngn::Content::Post.find(5))
URI::PlateID.create(Ngn::Content::Post)


78
79
80
81
# File 'lib/uri/plate_id.rb', line 78

def create(model)
  model = model.new if model.class == Class
  build(model_name: model.class.name, model_id: model.id)
end