Class: DiceBag::Transform

Inherits:
Parslet::Transform
  • Object
show all
Defined in:
lib/dicebag/transform.rb

Overview

This is the Transform subclass that takes the parsed tree and transforms it into its (almost) final form. (It gets a normalization pass later.)

Class Method Summary collapse

Class Method Details

.hashify_options(options) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/dicebag/transform.rb', line 7

def self.hashify_options(options)
  return options if options.is_a? Hash

  opts = {}

  options.each { |val| opts.update val } if options.respond_to?(:each)

  opts
end