Sha256: c4ba1402799bfc30043d3c3f12ec50b26f9c23d3556f6155f030ae3fe3ff23fa
Contents?: true
Size: 1.04 KB
Versions: 1
Compression:
Stored size: 1.04 KB
Contents
require 'growi/client/model/growi_model' # Growi Page revision model class class GrowiPageRevision < GrowiModelBase attr_reader :_id, :author, :body, :path, :__v, :createdAt, :format # Constractor # @param [Hash] User model shown as hash # @todo Except running register method always called parse method. def initialize(params = {}) init_params = { _id: '', author: nil, body: nil, path: nil, __v: 0, createdAt: nil, format: '' } params = init_params.merge(params.map { |k,v| [k.to_sym, v] }.to_h) if (params[:_id] == nil || params[:path] == nil) raise ArgumentError.new('Parameters _id and path are required.') end GrowiModelFactory.instance.register({ page_revision_createdAt: Proc.new { |date_str| date_str != nil && DateTime.parse(date_str) }, }) maked_params = {} params.each do |k,v| maker = GrowiModelFactory.instance.maker('page_revision_' + k.to_s) maked_params[k] = maker.call(v) end super(maked_params) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
growi-client-0.9.0 | lib/growi/client/model/growi_page_revision.rb |