Class: Hipbot::Plugins::MemeGenerator::Generator

Inherits:
Object
  • Object
show all
Defined in:
lib/hipbot-plugins/meme_generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(meme, text) ⇒ Generator

Returns a new instance of Generator.



28
29
30
31
# File 'lib/hipbot-plugins/meme_generator.rb', line 28

def initialize meme, text
  @meme = meme
  assign_texts(text)
end

Instance Attribute Details

#lower_textObject (readonly)

Returns the value of attribute lower_text.



27
28
29
# File 'lib/hipbot-plugins/meme_generator.rb', line 27

def lower_text
  @lower_text
end

#memeObject (readonly)

Returns the value of attribute meme.



27
28
29
# File 'lib/hipbot-plugins/meme_generator.rb', line 27

def meme
  @meme
end

#upper_textObject (readonly)

Returns the value of attribute upper_text.



27
28
29
# File 'lib/hipbot-plugins/meme_generator.rb', line 27

def upper_text
  @upper_text
end

Instance Method Details

#image_urlObject



33
34
35
36
# File 'lib/hipbot-plugins/meme_generator.rb', line 33

def image_url
  meme_name = self.class.memes.fetch(meme.to_s)
  "http://v1.memecaptain.com/#{meme_name}.png"
end