Class: Smplkit::Audit::Forwarder

Inherits:
Struct
  • Object
show all
Defined in:
lib/smplkit/audit/forwarders.rb

Overview

rubocop:disable Lint/StructNewOverride – “:filter“ matches the API attribute and shadowing Struct#filter is the expected ergonomics.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at

Returns:

  • (Object)

    the current value of created_at



185
186
187
# File 'lib/smplkit/audit/forwarders.rb', line 185

def created_at
  @created_at
end

#dataObject

Returns the value of attribute data

Returns:

  • (Object)

    the current value of data



185
186
187
# File 'lib/smplkit/audit/forwarders.rb', line 185

def data
  @data
end

#deleted_atObject

Returns the value of attribute deleted_at

Returns:

  • (Object)

    the current value of deleted_at



185
186
187
# File 'lib/smplkit/audit/forwarders.rb', line 185

def deleted_at
  @deleted_at
end

#enabledObject

Returns the value of attribute enabled

Returns:

  • (Object)

    the current value of enabled



185
186
187
# File 'lib/smplkit/audit/forwarders.rb', line 185

def enabled
  @enabled
end

#filterObject

Returns the value of attribute filter

Returns:

  • (Object)

    the current value of filter



185
186
187
# File 'lib/smplkit/audit/forwarders.rb', line 185

def filter
  @filter
end

#forwarder_typeObject

Returns the value of attribute forwarder_type

Returns:

  • (Object)

    the current value of forwarder_type



185
186
187
# File 'lib/smplkit/audit/forwarders.rb', line 185

def forwarder_type
  @forwarder_type
end

#httpObject

Returns the value of attribute http

Returns:

  • (Object)

    the current value of http



185
186
187
# File 'lib/smplkit/audit/forwarders.rb', line 185

def http
  @http
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



185
186
187
# File 'lib/smplkit/audit/forwarders.rb', line 185

def id
  @id
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



185
186
187
# File 'lib/smplkit/audit/forwarders.rb', line 185

def name
  @name
end

#slugObject

Returns the value of attribute slug

Returns:

  • (Object)

    the current value of slug



185
186
187
# File 'lib/smplkit/audit/forwarders.rb', line 185

def slug
  @slug
end

#transformObject

Returns the value of attribute transform

Returns:

  • (Object)

    the current value of transform



185
186
187
# File 'lib/smplkit/audit/forwarders.rb', line 185

def transform
  @transform
end

#updated_atObject

Returns the value of attribute updated_at

Returns:

  • (Object)

    the current value of updated_at



185
186
187
# File 'lib/smplkit/audit/forwarders.rb', line 185

def updated_at
  @updated_at
end

#versionObject

Returns the value of attribute version

Returns:

  • (Object)

    the current value of version



185
186
187
# File 'lib/smplkit/audit/forwarders.rb', line 185

def version
  @version
end

Class Method Details

.from_resource(resource) ⇒ Object



191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/smplkit/audit/forwarders.rb', line 191

def self.from_resource(resource)
  a = resource.attributes
  new(
    id: resource.id,
    name: a.name,
    slug: a.slug,
    forwarder_type: a.forwarder_type,
    enabled: a.enabled.nil? || a.enabled,
    filter: a.filter,
    transform: a.transform,
    http: ForwarderHttp.from_wire(a.http),
    data: a.data || {},
    created_at: a.created_at,
    updated_at: a.updated_at,
    deleted_at: a.deleted_at,
    version: a.version
  )
end