Class: NewsmastMastodon::AlttextCreateImage

Inherits:
Object
  • Object
show all
Defined in:
app/models/newsmast_mastodon/alttext_create_image.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response_hash = {}) ⇒ AlttextCreateImage

Returns a new instance of AlttextCreateImage.



7
8
9
10
11
12
13
14
15
16
# File 'app/models/newsmast_mastodon/alttext_create_image.rb', line 7

def initialize(response_hash = {})
  @asset_id   = response_hash['asset_id']
  @url        = response_hash['url']
  @alt_text   = response_hash['alt_text']
  @alt_texts  = response_hash['alt_texts']
  @metadata   = response_hash['metadata']
  @created_at = response_hash['created_at']
  @errors     = response_hash['errors']
  @error_code = response_hash['error_code']
end

Instance Attribute Details

#alt_textObject

Returns the value of attribute alt_text.



5
6
7
# File 'app/models/newsmast_mastodon/alttext_create_image.rb', line 5

def alt_text
  @alt_text
end

#alt_textsObject

Returns the value of attribute alt_texts.



5
6
7
# File 'app/models/newsmast_mastodon/alttext_create_image.rb', line 5

def alt_texts
  @alt_texts
end

#asset_idObject

Returns the value of attribute asset_id.



5
6
7
# File 'app/models/newsmast_mastodon/alttext_create_image.rb', line 5

def asset_id
  @asset_id
end

#created_atObject

Returns the value of attribute created_at.



5
6
7
# File 'app/models/newsmast_mastodon/alttext_create_image.rb', line 5

def created_at
  @created_at
end

#error_codeObject

Returns the value of attribute error_code.



5
6
7
# File 'app/models/newsmast_mastodon/alttext_create_image.rb', line 5

def error_code
  @error_code
end

#errorsObject

Returns the value of attribute errors.



5
6
7
# File 'app/models/newsmast_mastodon/alttext_create_image.rb', line 5

def errors
  @errors
end

#metadataObject

Returns the value of attribute metadata.



5
6
7
# File 'app/models/newsmast_mastodon/alttext_create_image.rb', line 5

def 
  @metadata
end

#urlObject

Returns the value of attribute url.



5
6
7
# File 'app/models/newsmast_mastodon/alttext_create_image.rb', line 5

def url
  @url
end

Instance Method Details

#has_errors?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'app/models/newsmast_mastodon/alttext_create_image.rb', line 18

def has_errors?
  @error_code.present? || @errors.present?
end