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

- (Object) caption

Returns the value of attribute caption



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

def caption
  @caption
end

- (Object) description

Returns the value of attribute description



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

def description
  @description
end

- (Object) href

Returns the value of attribute href



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

def href
  @href
end

- (Object) icon

Returns the value of attribute icon



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

def icon
  @icon
end

- (Object) name

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

- (Boolean) link?

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

- (Boolean) photo?

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

- (Boolean) video?

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