Class: Logr::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/logr/event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, tags) ⇒ Event

Returns a new instance of Event.



5
6
7
# File 'lib/logr/event.rb', line 5

def initialize(name, tags)
  @name, @tags = name, tags
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/logr/event.rb', line 3

def name
  @name
end

#tagsObject (readonly)

Returns the value of attribute tags.



3
4
5
# File 'lib/logr/event.rb', line 3

def tags
  @tags
end

Instance Method Details

#to_hashObject



9
10
11
# File 'lib/logr/event.rb', line 9

def to_hash
  { name: @name }.merge(@tags)
end

#with(tags) ⇒ Object



13
14
15
# File 'lib/logr/event.rb', line 13

def with(tags)
  Event.new(@name, @tags.merge(tags))
end