lib/rabbit/slide-configuration.rb in rabbit-2.0.5 vs lib/rabbit/slide-configuration.rb in rabbit-2.0.6

- old
+ new

@@ -30,11 +30,12 @@ GEM_NAME_PREFIX = "rabbit-slide" attr_accessor :logger attr_accessor :id, :base_name, :tags, :presentation_date - attr_accessor :licenses, :slideshare_id, :speaker_deck_id + attr_accessor :licenses + attr_accessor :slideshare_id, :speaker_deck_id, :ustream_id, :vimeo_id attr_writer :version attr_accessor :author def initialize(logger=nil) @logger = logger || Logger.default clear @@ -67,25 +68,29 @@ @presentation_date = nil @version = nil @licenses = [] @slideshare_id = nil @speaker_deck_id = nil + @ustream_id = nil + @vimeo_id = nil @author = nil end def merge!(conf) - @id ||= conf["id"] - @base_name ||= conf["base_name"] - @presentation_date ||= conf["presentation_date"] - @version ||= conf["version"] - @slideshare_id ||= conf["slideshare_id"] - @speaker_deck_id ||= conf["speaker_deck_id"] + @id = conf["id"] || @id + @base_name = conf["base_name"] || @base_name + @presentation_date = conf["presentation_date"] || @presentation_date + @version = conf["version"] || @version + @slideshare_id = conf["slideshare_id"] || @slideshare_id + @speaker_deck_id = conf["speaker_deck_id"] || @speaker_deck_id + @ustream_id = conf["ustream_id"] || @ustream_id + @vimeo_id = conf["vimeo_id"] || @vimeo_id @tags |= (conf["tags"] || []) @licenses |= (conf["licenses"] || []) - @author = AuthorConfiguration.new(@logger) + @author ||= AuthorConfiguration.new(@logger) @author.merge!(conf["author"] || {}) end def to_hash config = { @@ -95,9 +100,11 @@ "presentation_date" => @presentation_date, "version" => version, "licenses" => @licenses, "slideshare_id" => @slideshare_id, "speaker_deck_id" => @speaker_deck_id, + "ustream_id" => @ustream_id, + "vimeo_id" => @vimeo_id, } config["author"] = @author.to_hash if @author config end