Class: SendgridNotification::SendgridStatus::Suppression

Inherits:
Struct
  • Object
show all
Defined in:
app/models/sendgrid_notification/sendgrid_status.rb

Overview

mapped to sendgrid api result e.g. sendgrid.com/docs/API_Reference/Web_API_v3/blocks.html ( なお invalid_emails には status がない。そもそも送っていないから。 )

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#createdObject

Returns the value of attribute created

Returns:

  • (Object)

    the current value of created



10
11
12
# File 'app/models/sendgrid_notification/sendgrid_status.rb', line 10

def created
  @created
end

#emailObject

Returns the value of attribute email

Returns:

  • (Object)

    the current value of email



10
11
12
# File 'app/models/sendgrid_notification/sendgrid_status.rb', line 10

def email
  @email
end

#reasonObject

Returns the value of attribute reason

Returns:

  • (Object)

    the current value of reason



10
11
12
# File 'app/models/sendgrid_notification/sendgrid_status.rb', line 10

def reason
  @reason
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



10
11
12
# File 'app/models/sendgrid_notification/sendgrid_status.rb', line 10

def status
  @status
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



10
11
12
# File 'app/models/sendgrid_notification/sendgrid_status.rb', line 10

def type
  @type
end

Class Method Details

.build(type, hash) ⇒ Object



11
12
13
# File 'app/models/sendgrid_notification/sendgrid_status.rb', line 11

def self.build(type, hash)
  new(type, *hash.values_at('created', 'email', 'reason', 'status'))
end

Instance Method Details

#to_sObject



15
16
17
# File 'app/models/sendgrid_notification/sendgrid_status.rb', line 15

def to_s
  to_h.to_json
end