lib/gnuplotrb/staff/dataset.rb
##
# Create new dataset with existing options merged with
# the given ones. Does nothing if no options given.
#
# @param options [Hash] new options to merge with existing options
# @return [Dataset] self if options empty
# @return [Dataset] new Dataset with updated options otherwise
# @example Updating dataset with Math formula or filename given:
#   dataset = Dataset.new('file.data')
#   dataset.update_options(title: 'File')
#   #=> Dataset.new('file.data', title: 'File')
Create new dataset with existing options merged with
the given ones. Does nothing if no options given.
Create new dataset with existing options merged with the given ones . Does nothing if no options given .
def update_options(**options)
      if options.empty?
        self
      else
        new_with_options(@options.merge(options))
      end
    end
def update_options ( ** options ) if options . empty? self else new_with_options ( @options . merge ( options ) ) end end
Create new dataset with existing options merged with
the given ones.
Create new dataset with existing options merged with the given ones .
self if options empty
self if options empty
Dataset
new Dataset with updated options otherwise
new Dataset with updated options otherwise
Dataset
options
new options to merge with existing options
new options to merge with existing options
example
Updating dataset with Math formula or filename given: dataset = Dataset.new('file.data') dataset.update_options(title: 'File') #=> Dataset.new('file.data', title: 'File')
Updating dataset with Math formula or filename given : dataset = Dataset . new ( ' file . data ' ) dataset . update_options ( title : ' File ' ) # = > Dataset . new ( ' file . data ' title : ' File ' )