Sha256: 0e5ba476ccfc9039edccaf9e70b8bf235f735b59a133555dd317bb30c070491e

Contents?: true

Size: 486 Bytes

Versions: 9

Compression:

Stored size: 486 Bytes

Contents

class LinkOracle
  class LinkData
    class Data
      attr_accessor :titles, :image_urls, :descriptions

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

      def image_url
        image_urls.first
      end

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

      def title
        titles.first
      end

      def description
        descriptions.first
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
link_oracle-0.1.11 lib/link_oracle/link_data/data.rb
link_oracle-0.1.10 lib/link_oracle/link_data/data.rb
link_oracle-0.1.9 lib/link_oracle/link_data/data.rb
link_oracle-0.1.8 lib/link_oracle/link_data/data.rb
link_oracle-0.1.7 lib/link_oracle/link_data/data.rb
link_oracle-0.1.6 lib/link_oracle/link_data/data.rb
link_oracle-0.1.5 lib/link_oracle/link_data/data.rb
link_oracle-0.1.4 lib/link_oracle/link_data/data.rb
link_oracle-0.1.3 lib/link_oracle/link_data/data.rb