Class: Twitter2Mastodon::Status

Inherits:
Object
  • Object
show all
Defined in:
lib/twitter2mastodon/status.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(twitt_object) ⇒ Status

Returns a new instance of Status.



5
6
7
8
9
10
# File 'lib/twitter2mastodon/status.rb', line 5

def initialize(twitt_object)
  @id = twitt_object.id
  @name = twitt_object.user.name
  @message = twitt_object.full_text
  @url = twitt_object.url
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'lib/twitter2mastodon/status.rb', line 3

def id
  @id
end

#messageObject (readonly)

Returns the value of attribute message.



3
4
5
# File 'lib/twitter2mastodon/status.rb', line 3

def message
  @message
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/twitter2mastodon/status.rb', line 3

def name
  @name
end

#urlObject (readonly)

Returns the value of attribute url.



3
4
5
# File 'lib/twitter2mastodon/status.rb', line 3

def url
  @url
end

Instance Method Details

#statusObject



12
13
14
# File 'lib/twitter2mastodon/status.rb', line 12

def status
  "#{name}\n\n#{message}\n\nOriginal tweet:#{url}"
end