Class ConfigStruct

  1. lib/config_struct.rb
Parent: OpenStruct

Methods

public class

  1. block_to_hash

Public class methods

block_to_hash (block=nil)

Converts the data within the given block to hash

[show source]
# File lib/config_struct.rb, line 5
  def self.block_to_hash(block=nil)
    config = self.new
    if block
      block.call(config)
      config.to_hash
    else
      {}
    end
  end