Sha256: 1d2f444f34bf69315621d0105a154bf922ac1ae66ce4418033bf7a2329938bac

Contents?: true

Size: 470 Bytes

Versions: 6

Compression:

Stored size: 470 Bytes

Contents

class Isomer::Base
  attr_reader :source, :base

  def self.from(source_type, options = {})
    source = Isomer::Sources.factory(source_type, @parameters, options)
    source.load_and_validate

    new(source)
  end

  def self.parameter(id, options = {})
    parameter = Isomer::Parameter.new(id, options)
    (@parameters ||= []) << parameter

    define_method(id) do
      source.for(parameter)
    end
  end

  def initialize(source)
    @source = source
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
isomer-0.1.4 lib/isomer/base.rb
isomer-0.1.3 lib/isomer/base.rb
isomer-0.1.2 lib/isomer/base.rb
isomer-0.1.1 lib/isomer/base.rb
isomer-0.1.0 lib/isomer/base.rb
isomer-0.0.1 lib/isomer/base.rb