Class: Gophish::Campaign::Event
- Inherits:
-
Object
- Object
- Gophish::Campaign::Event
- Includes:
- ActiveModel::Attributes, ActiveModel::Model
- Defined in:
- lib/gophish/campaign.rb
Instance Method Summary collapse
Instance Method Details
#has_details? ⇒ Boolean
330 331 332 |
# File 'lib/gophish/campaign.rb', line 330 def has_details? !details.blank? end |
#inspect ⇒ Object
351 352 353 |
# File 'lib/gophish/campaign.rb', line 351 def inspect to_s end |
#parsed_details ⇒ Object
334 335 336 337 338 339 340 |
# File 'lib/gophish/campaign.rb', line 334 def parsed_details return {} if details.blank? JSON.parse details rescue JSON::ParserError {} end |
#to_s ⇒ Object
342 343 344 345 346 347 348 349 |
# File 'lib/gophish/campaign.rb', line 342 def to_s attributes_hash = {} self.class.attribute_names.each do |attr_name| value = send attr_name attributes_hash[attr_name.to_sym] = value unless value.nil? end attributes_hash.to_s end |