Class: EY::Serverside::Adapter::CommandOptions
- Inherits:
-
Object
- Object
- EY::Serverside::Adapter::CommandOptions
- Defined in:
- lib/engineyard-serverside-adapter/command_options.rb
Defined Under Namespace
Modules: ClassMethods
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #add(*args) ⇒ Object
- #applicable(version) ⇒ Object
-
#initialize ⇒ CommandOptions
constructor
A new instance of CommandOptions.
- #required(version) ⇒ Object
- #select(&block) ⇒ Object
Constructor Details
#initialize ⇒ CommandOptions
Returns a new instance of CommandOptions.
14 15 16 |
# File 'lib/engineyard-serverside-adapter/command_options.rb', line 14 def initialize self. = [] end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
12 13 14 |
# File 'lib/engineyard-serverside-adapter/command_options.rb', line 12 def @options end |
Instance Method Details
#add(*args) ⇒ Object
18 19 20 21 22 |
# File 'lib/engineyard-serverside-adapter/command_options.rb', line 18 def add(*args) option = EY::Serverside::Adapter::Option.new(*args) self. << option option end |
#applicable(version) ⇒ Object
24 25 26 |
# File 'lib/engineyard-serverside-adapter/command_options.rb', line 24 def applicable(version) select { |option| option.on_version?(version) } end |
#required(version) ⇒ Object
28 29 30 |
# File 'lib/engineyard-serverside-adapter/command_options.rb', line 28 def required(version) select { |option| option.required_on_version?(version) } end |
#select(&block) ⇒ Object
32 33 34 |
# File 'lib/engineyard-serverside-adapter/command_options.rb', line 32 def select(&block) self..select(&block) end |