Class: Quilt::Performance::EventMetadata

Inherits:
Object
  • Object
show all
Defined in:
lib/quilt_rails/performance/event_metadata.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, size:) ⇒ EventMetadata

Returns a new instance of EventMetadata.



16
17
18
19
# File 'lib/quilt_rails/performance/event_metadata.rb', line 16

def initialize(name:, size:)
  @name = name
  @size = size
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/quilt_rails/performance/event_metadata.rb', line 6

def name
  @name
end

#sizeObject

Returns the value of attribute size.



7
8
9
# File 'lib/quilt_rails/performance/event_metadata.rb', line 7

def size
  @size
end

Class Method Details

.from_params(params) ⇒ Object



9
10
11
12
13
14
# File 'lib/quilt_rails/performance/event_metadata.rb', line 9

def self.from_params(params)
  EventMetadata.new(
    name: params[:name],
    size: params[:size],
  )
end

Instance Method Details

#has_size?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/quilt_rails/performance/event_metadata.rb', line 21

def has_size?
  !size.nil?
end