Class: Editus::Action

Inherits:
Object
  • Object
show all
Defined in:
lib/editus/actions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Action

Returns a new instance of Action.



37
38
39
40
41
42
43
44
45
# File 'lib/editus/actions.rb', line 37

def initialize **args
  @id = args[:id] || SecureRandom.uuid
  @created_at = args[:created_at] || Time.now.utc
  @model_id = args[:model_id]
  @model_name = args[:model_name]
  @changes = args[:changes]
  @type = args[:type]
  @user = args[:user]
end

Instance Attribute Details

#changesObject

Returns the value of attribute changes.



35
36
37
# File 'lib/editus/actions.rb', line 35

def changes
  @changes
end

#created_atObject

Returns the value of attribute created_at.



35
36
37
# File 'lib/editus/actions.rb', line 35

def created_at
  @created_at
end

#idObject

Returns the value of attribute id.



35
36
37
# File 'lib/editus/actions.rb', line 35

def id
  @id
end

#model_idObject

Returns the value of attribute model_id.



35
36
37
# File 'lib/editus/actions.rb', line 35

def model_id
  @model_id
end

#model_nameObject

Returns the value of attribute model_name.



35
36
37
# File 'lib/editus/actions.rb', line 35

def model_name
  @model_name
end

#typeObject

Returns the value of attribute type.



35
36
37
# File 'lib/editus/actions.rb', line 35

def type
  @type
end

#userObject

Returns the value of attribute user.



35
36
37
# File 'lib/editus/actions.rb', line 35

def user
  @user
end

Instance Method Details

#saveObject



47
48
49
# File 'lib/editus/actions.rb', line 47

def save
  Editus::Actions.create self
end