Sha256: facd9b35555178173b078b13848136235403a9f08cde38f33072d34046c3535a

Contents?: true

Size: 298 Bytes

Versions: 3

Compression:

Stored size: 298 Bytes

Contents

require 'ostruct'

class ConfigStruct < OpenStruct
  # Converts the data within the given block to hash
  def self.block_to_hash(block=nil)
    config = self.new
    if block
      block.call(config)
      config.to_hash
    else
      {}
    end
  end

  def to_hash #:nodoc:
    @table
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
cldwalker-local_gem-0.1.1 lib/config_struct.rb
cldwalker-local_gem-0.1.2 lib/config_struct.rb
local_gem-0.1.3 lib/config_struct.rb