Class: Adminix::Entities::Log

Inherits:
Object
  • Object
show all
Defined in:
lib/adminix/entities/log.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, tag = nil) ⇒ Log

Returns a new instance of Log.



6
7
8
9
10
# File 'lib/adminix/entities/log.rb', line 6

def initialize(message, tag = nil)
  @message = message
  @tag = tag || 'default'
  @created_at = Time.now
end

Instance Attribute Details

#created_atObject (readonly)

Returns the value of attribute created_at.



4
5
6
# File 'lib/adminix/entities/log.rb', line 4

def created_at
  @created_at
end

#messageObject (readonly)

Returns the value of attribute message.



4
5
6
# File 'lib/adminix/entities/log.rb', line 4

def message
  @message
end

#tagObject (readonly)

Returns the value of attribute tag.



4
5
6
# File 'lib/adminix/entities/log.rb', line 4

def tag
  @tag
end

Instance Method Details

#to_apiObject



12
13
14
15
16
17
18
# File 'lib/adminix/entities/log.rb', line 12

def to_api
  {
    message: message,
    tag: tag,
    created_at: created_at
  }
end