module Conferrable

This is the main module that contains the class-level methods that define the main API.

Copyright © 2018-present, Blue Marble Payroll, LLC

This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.

Copyright © 2018-present, Blue Marble Payroll, LLC

This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.

Copyright © 2018-present, Blue Marble Payroll, LLC

This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.

Copyright © 2018-present, Blue Marble Payroll, LLC

This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.

Copyright © 2018-present, Blue Marble Payroll, LLC

This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.

Constants

GET_PREFIX_MATCHER_REGEX
GET_PREFIX_REGEX
VERSION

Public Class Methods

[](key) click to toggle source
# File lib/conferrable/conferrable.rb, line 34
def [](key)
  get(key)
end
clear!() click to toggle source
# File lib/conferrable/conferrable.rb, line 24
def clear!
  @entries = {}

  nil
end
entry(key) click to toggle source
# File lib/conferrable/conferrable.rb, line 42
def entry(key)
  clear! unless @entries

  @entries[key.to_s] = Entry.new(key) unless @entries[key.to_s]

  @entries[key.to_s]
end
get(key) click to toggle source
# File lib/conferrable/conferrable.rb, line 38
def get(key)
  entry(key).all
end
method_missing(method_sym, *arguments, &block) click to toggle source
Calls superclass method
# File lib/conferrable/conferrable.rb, line 50
def method_missing(method_sym, *arguments, &block)
  if method_sym.to_s =~ GET_PREFIX_MATCHER_REGEX
    get(keyify(method_sym))
  else
    super
  end
end
respond_to_missing?(method_sym, include_private = false) click to toggle source
Calls superclass method
# File lib/conferrable/conferrable.rb, line 58
def respond_to_missing?(method_sym, include_private = false)
  method_sym.to_s =~ GET_PREFIX_MATCHER_REGEX || super
end
set_filenames(key, filenames) click to toggle source
# File lib/conferrable/conferrable.rb, line 30
def set_filenames(key, filenames)
  entry(key).filenames = filenames
end

Private Class Methods

keyify(val) click to toggle source
# File lib/conferrable/conferrable.rb, line 64
def keyify(val)
  val.to_s.sub(GET_PREFIX_REGEX, '')
end