Class: Facebooker::MessageThread::Message::Attachment

Inherits:
Object
  • Object
show all
Includes:
Facebooker::Model
Defined in:
lib/facebooker/models/message_thread.rb

Overview

An attachment can be a photo, a video, or a link

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Facebooker::Model

#anon=, included, #initialize, #populate, #populate_from_hash!, #populated?, #session

Instance Attribute Details

#captionObject

Returns the value of attribute caption.



20
21
22
# File 'lib/facebooker/models/message_thread.rb', line 20

def caption
  @caption
end

#descriptionObject

Returns the value of attribute description.



20
21
22
# File 'lib/facebooker/models/message_thread.rb', line 20

def description
  @description
end

#hrefObject

Returns the value of attribute href.



20
21
22
# File 'lib/facebooker/models/message_thread.rb', line 20

def href
  @href
end

#iconObject

Returns the value of attribute icon.



20
21
22
# File 'lib/facebooker/models/message_thread.rb', line 20

def icon
  @icon
end

#nameObject

Returns the value of attribute name.



20
21
22
# File 'lib/facebooker/models/message_thread.rb', line 20

def name
  @name
end

Instance Method Details

#link?Boolean

The Facebook messages API is in beta, this helper method is supposed to fail anytime soon

Returns:

  • (Boolean)


33
34
35
# File 'lib/facebooker/models/message_thread.rb', line 33

def link?
  !video? && !photo?
end

#photo?Boolean

The Facebook messages API is in beta, this helper method is supposed to fail anytime soon

Returns:

  • (Boolean)


28
29
30
# File 'lib/facebooker/models/message_thread.rb', line 28

def photo?
  self.href =~ /\Ahttp:\/\/www\.facebook\.com\/photo\.php.*/
end

#video?Boolean

The Facebook messages API is in beta, this helper method is supposed to fail anytime soon

Returns:

  • (Boolean)


23
24
25
# File 'lib/facebooker/models/message_thread.rb', line 23

def video?
  self.href =~ /\Ahttp:\/\/www\.facebook\.com\/video\/video\.php.*/
end