Class: CLI::DSL::Base
- Inherits:
-
Object
- Object
- CLI::DSL::Base
- Defined in:
- lib/cli/dsl.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, options = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(name, options = {}) ⇒ Base
Returns a new instance of Base.
4 5 6 7 8 9 10 |
# File 'lib/cli/dsl.rb', line 4 def initialize(name, = {}) class_name = self.class.name.gsub(/.*:/, '').downcase raise ParserError::NameArgumetNotSymbolError.new(class_name, name) unless name.is_a? Symbol raise ParserError::OptionsArgumentNotHashError.new(class_name, ) unless .is_a? Hash @name = name @options = end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
12 13 14 |
# File 'lib/cli/dsl.rb', line 12 def name @name end |