Module: Rrant::Helper

Included in:
Handler, Local, Remote, Store
Defined in:
lib/rrant/helper.rb

Instance Method Summary collapse

Instance Method Details

#billObject



11
12
13
14
15
16
17
18
# File 'lib/rrant/helper.rb', line 11

def bill
  {
    'text'          => '80 rants should be enough.',
    'image'         => "#{files_path}/bill.jpg",
    'score'         => 80,
    'user_username' => 'Bill'
  }
end

#files_pathObject



7
8
9
# File 'lib/rrant/helper.rb', line 7

def files_path
  File.expand_path('../../files/', File.dirname(__FILE__))
end

#image_blank?(rant) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
# File 'lib/rrant/helper.rb', line 3

def image_blank?(rant)
  rant['attached_image'].nil? || rant['attached_image'] == ''
end