Sha256: 65b6470e3c3e5fccf094709c5ed2ed2aa3581067bcab45504dec63ddfce082d0
Contents?: true
Size: 1.56 KB
Versions: 1
Compression:
Stored size: 1.56 KB
Contents
class NewButton < Scrivener attr_accessor :key, :page_url, :button_template, :page_title attr_accessor :auto_fill, :advanced_options, :variants def validate assert_present :key assert_url :page_url assert_present :page_title assert_member :button_template, %w{sp_em_small sp_em_large sp_tw_small sp_tw_large sp_fb_small sp_fb_large} assert_present :variants if auto_fill assert auto_fill == false || auto_fill == true, [:auto_fill, :not_boolean] end if advanced_options if advanced_options["automatic_traffic_routing"] assert advanced_options["automatic_traffic_routing"] == false || advanced_options["automatic_traffic_routing"] == true, [:automatic_traffic_routing, :not_boolean] end if advanced_options["buttons_optimize_actions"] assert advanced_options["buttons_optimize_actions"] == false || advanced_options["buttons_optimize_actions"] == true, [:buttons_optimize_actions, :not_boolean] end if advanced_options["customize_params"] cp = advanced_options["customize_params"] assert !cp["param"].nil?, [:param, :not_present] assert !cp["e"].nil?, [:e, :not_present] assert !cp["f"].nil?, [:f, :not_present] assert !cp["t"].nil?, [:t, :not_present] assert !cp["o"].nil?, [:o, :not_present] end if advanced_options["id_pass"] ip = advanced_options["id_pass"] assert !ip["id"].nil?, [:id, :not_present] assert !ip["passed"].nil?, [:passed, :not_present] end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
shareprogress-0.0.2 | lib/shareprogress/filters/new_button.rb |