class StarButterfly

Public Class Methods

activate() click to toggle source
# File lib/starbutterfly.rb, line 66
def activate
        incantation = ''
        spell.each do |s|
                incantation << 🖌["#{s} ", 🌈]
        end
        incantation.chomp!
        incantation << '!'
        puts incantation
end
cast!() click to toggle source
# File lib/starbutterfly.rb, line 80
def cast!
        StarButterfly.time_for_some_magic
        StarButterfly.dip_down
        StarButterfly.scrape_the_sides
        StarButterfly.activate
end
component_level() click to toggle source
# File lib/starbutterfly.rb, line 38
def component_level
        @@component_level
end
components() click to toggle source
# File lib/starbutterfly.rb, line 34
def components
        @@components
end
dip_down() click to toggle source
# File lib/starbutterfly.rb, line 54
def dip_down
        component_level.times do
                component = components.sample
                spell << component
                components.delete(component)
        end
end
enhancement_level() click to toggle source
# File lib/starbutterfly.rb, line 30
def enhancement_level
        @@enhancement_level
end
enhancers() click to toggle source
# File lib/starbutterfly.rb, line 26
def enhancers
        @@enhancers
end
outputs() click to toggle source
# File lib/starbutterfly.rb, line 42
def outputs
        @@outputs
end
scrape_the_sides() click to toggle source
# File lib/starbutterfly.rb, line 62
def scrape_the_sides
        spell << outputs.sample
end
send_through_portal() click to toggle source
# File lib/starbutterfly.rb, line 76
def send_through_portal
        return spell.join(" ") + "!"
end
spell() click to toggle source
# File lib/starbutterfly.rb, line 22
def spell
        @@spell
end
time_for_some_magic() click to toggle source
# File lib/starbutterfly.rb, line 46
def time_for_some_magic
        enhancement_level.times do
                enhancer = enhancers.sample
                spell << enhancer
                enhancers.delete(enhancer)
        end
end
tweet!() click to toggle source
# File lib/starbutterfly.rb, line 87
def tweet!
        StarButterfly.time_for_some_magic
        StarButterfly.dip_down
        StarButterfly.scrape_the_sides
        tweet_spell = URI.encode(StarButterfly.send_through_portal)
        url = "https://twitter.com/intent/tweet?text=#{tweet_spell}&hashtags=FromAnotherDimension"
        Launchy.open(url)
end
🌈() click to toggle source
# File lib/starbutterfly.rb, line 14
def 🌈
        return "%06x" % (rand * 0xffffff)
end
🖌() click to toggle source
# File lib/starbutterfly.rb, line 18
def 🖌
        Paint
end