Sha256: d5fa61b8f8632b673bd8bb5be818faa21fe6f98db61bfa845a457f08f75db9e8

Contents?: true

Size: 665 Bytes

Versions: 4

Compression:

Stored size: 665 Bytes

Contents

class EY::Serverside::Adapter::CommandOptions
  module ClassMethods
    def command_options
      @options ||= EY::Serverside::Adapter::CommandOptions.new
    end

    def option(*args)
      command_options.add(*args)
    end
  end

  attr_accessor :options

  def initialize
    self.options = []
  end

  def add(*args)
    option = EY::Serverside::Adapter::Option.new(*args)
    self.options << option
    option
  end

  def applicable(version)
    select { |option| option.on_version?(version) }
  end

  def required(version)
    select { |option| option.required_on_version?(version) }
  end

  def select(&block)
    self.options.select(&block)
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
engineyard-serverside-adapter-2.5.0 lib/engineyard-serverside-adapter/command_options.rb
engineyard-serverside-adapter-2.4.0 lib/engineyard-serverside-adapter/command_options.rb
engineyard-serverside-adapter-2.3.1 lib/engineyard-serverside-adapter/command_options.rb
engineyard-serverside-adapter-2.3.0 lib/engineyard-serverside-adapter/command_options.rb