Class: CrowiPageRevision
- Inherits:
-
CrowiModelBase
- Object
- CrowiModelBase
- CrowiPageRevision
- Defined in:
- lib/crowi/client/model/crowi_page_revision.rb
Overview
Crowi Page revision model class
Instance Attribute Summary collapse
-
#__v ⇒ Object
readonly
Returns the value of attribute __v.
-
#_id ⇒ Object
readonly
Returns the value of attribute _id.
-
#author ⇒ Object
readonly
Returns the value of attribute author.
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#createdAt ⇒ Object
readonly
Returns the value of attribute createdAt.
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ CrowiPageRevision
constructor
Constractor.
Constructor Details
#initialize(params = {}) ⇒ CrowiPageRevision
TODO:
Except running register method always called parse method.
Constractor
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/crowi/client/model/crowi_page_revision.rb', line 10 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 CrowiModelFactory.instance.register({ page_revision_createdAt: Proc.new { |date_str| date_str != nil && DateTime.parse(date_str) }, }) maked_params = {} params.each do |k,v| maker = CrowiModelFactory.instance.maker('page_revision_' + k.to_s) maked_params[k] = maker.call(v) end super(maked_params) end |
Instance Attribute Details
#__v ⇒ Object (readonly)
Returns the value of attribute __v.
5 6 7 |
# File 'lib/crowi/client/model/crowi_page_revision.rb', line 5 def __v @__v end |
#_id ⇒ Object (readonly)
Returns the value of attribute _id.
5 6 7 |
# File 'lib/crowi/client/model/crowi_page_revision.rb', line 5 def _id @_id end |
#author ⇒ Object (readonly)
Returns the value of attribute author.
5 6 7 |
# File 'lib/crowi/client/model/crowi_page_revision.rb', line 5 def @author end |
#body ⇒ Object (readonly)
Returns the value of attribute body.
5 6 7 |
# File 'lib/crowi/client/model/crowi_page_revision.rb', line 5 def body @body end |
#createdAt ⇒ Object (readonly)
Returns the value of attribute createdAt.
5 6 7 |
# File 'lib/crowi/client/model/crowi_page_revision.rb', line 5 def createdAt @createdAt end |
#format ⇒ Object (readonly)
Returns the value of attribute format.
5 6 7 |
# File 'lib/crowi/client/model/crowi_page_revision.rb', line 5 def format @format end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
5 6 7 |
# File 'lib/crowi/client/model/crowi_page_revision.rb', line 5 def path @path end |