Class: Models::Log
- Inherits:
-
Object
- Object
- Models::Log
- Defined in:
- lib/models/log.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#data ⇒ Object
Returns the value of attribute data.
-
#id ⇒ Object
Returns the value of attribute id.
-
#status ⇒ Object
Returns the value of attribute status.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Instance Method Summary collapse
- #attributes_hash ⇒ Object
-
#initialize(attrs = {}) ⇒ Log
constructor
A new instance of Log.
- #jsonb(json) ⇒ Object
Constructor Details
#initialize(attrs = {}) ⇒ Log
Returns a new instance of Log.
5 6 7 8 9 |
# File 'lib/models/log.rb', line 5 def initialize(attrs = {}) attrs.each do |key, value| self.send("#{key}=", value) if respond_to?("#{key}=") end end |
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at.
3 4 5 |
# File 'lib/models/log.rb', line 3 def created_at @created_at end |
#data ⇒ Object
Returns the value of attribute data.
3 4 5 |
# File 'lib/models/log.rb', line 3 def data @data end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/models/log.rb', line 3 def id @id end |
#status ⇒ Object
Returns the value of attribute status.
3 4 5 |
# File 'lib/models/log.rb', line 3 def status @status end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
3 4 5 |
# File 'lib/models/log.rb', line 3 def updated_at @updated_at end |
Instance Method Details
#attributes_hash ⇒ Object
11 12 13 14 15 |
# File 'lib/models/log.rb', line 11 def attributes_hash instance_variables.each_with_object({}) do |var, hash| hash[var.to_s.delete('@').to_sym] = instance_variable_get(var) end end |
#jsonb(json) ⇒ Object
21 22 23 24 25 26 |
# File 'lib/models/log.rb', line 21 def jsonb(json) return if json.nil? return json if json.is_a?(String) Sequel&.pg_json(json) end |