Class: LinkOracle::LinkData::Data

Inherits:
Object
  • Object
show all
Defined in:
lib/link_oracle/link_data/data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#descriptionsObject

Returns the value of attribute descriptions.



4
5
6
# File 'lib/link_oracle/link_data/data.rb', line 4

def descriptions
  @descriptions
end

#image_urlsObject

Returns the value of attribute image_urls.



4
5
6
# File 'lib/link_oracle/link_data/data.rb', line 4

def image_urls
  @image_urls
end

#titlesObject

Returns the value of attribute titles.



4
5
6
# File 'lib/link_oracle/link_data/data.rb', line 4

def titles
  @titles
end

Instance Method Details

#assign(hash) ⇒ Object



6
7
8
9
# File 'lib/link_oracle/link_data/data.rb', line 6

def assign(hash)
  hash.each {|key, value| self.send("#{key}=", value) }
  self
end

#descriptionObject



23
24
25
# File 'lib/link_oracle/link_data/data.rb', line 23

def description
  descriptions.first
end

#format_image(image) ⇒ Object



15
16
17
# File 'lib/link_oracle/link_data/data.rb', line 15

def format_image(image)
  Utils::ImageUrlFormatter.new(url, image)
end

#image_urlObject



11
12
13
# File 'lib/link_oracle/link_data/data.rb', line 11

def image_url
  image_urls.first
end

#titleObject



19
20
21
# File 'lib/link_oracle/link_data/data.rb', line 19

def title
  titles.first
end