Class: Cliqr::InterfaceBuilder Private
- Inherits:
-
Object
- Object
- Cliqr::InterfaceBuilder
- Defined in:
- lib/cliqr/interface.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Builder for [Cliqr::CLI::Interface]
Instance Method Summary collapse
-
#build ⇒ Cliqr::CLI::Interface
private
Validate and build a cli interface based on the configuration options.
-
#initialize(config) ⇒ Cliqr::CLI::ConfigBuilder
constructor
private
Start building a command line interface.
Constructor Details
#initialize(config) ⇒ Cliqr::CLI::ConfigBuilder
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Start building a command line interface
interface (validated using CLI::Validator)
80 81 82 |
# File 'lib/cliqr/interface.rb', line 80 def initialize(config) @config = config end |
Instance Method Details
#build ⇒ Cliqr::CLI::Interface
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Validate and build a cli interface based on the configuration options
90 91 92 93 94 95 96 |
# File 'lib/cliqr/interface.rb', line 90 def build fail Cliqr::Error::ConfigNotFound, 'a valid config should be defined' if @config.nil? fail Cliqr::Error::ValidationError, \ "invalid Cliqr interface configuration - [#{@config.errors}]" unless @config.valid? Interface.new(@config) end |