Sha256: d18b4c1b0a32894e2b6a9dac666a414bc6f5061e27a6ec6424dbb622c88e2724

Contents?: true

Size: 358 Bytes

Versions: 4

Compression:

Stored size: 358 Bytes

Contents

class Review < PostType
  fields :rating, :item, :description, :url
  required :rating, :item
  primary :description
  heading :item
  
  special :rating do |rating_content|
    rating_content.to_f
  end
  
  special :url do |link_content|
    'http://' + link_content.gsub(/^http:\/\//, '')
  end
  
  def self.detect?(text)
    has_required? text
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
myobie-turbine-core-0.3.5 lib/turbine-core/types/review.rb
myobie-turbine-core-0.3.6 lib/turbine-core/types/review.rb
myobie-turbine-core-0.3.7 lib/turbine-core/types/review.rb
myobie-turbine-core-0.4.0 lib/turbine-core/types/review.rb