Class: Typescript::Monkey::Configuration
- Inherits:
-
Object
- Object
- Typescript::Monkey::Configuration
- Defined in:
- lib/typescript/monkey/configuration.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #compile=(value) ⇒ Object
- #default_options ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/typescript/monkey/configuration.rb', line 18 def initialize @_default_options = [ "--target es5", "--outFile /dev/stdout", "--noResolve", "--removeComments", "--typeRoots ['#{File.("../lib", Typescript::Monkey::Package.())}']" ] @options = @_default_options.to_set @compile = false; @logger = nil; end |
Instance Attribute Details
#logger ⇒ Object
Returns the value of attribute logger.
16 17 18 |
# File 'lib/typescript/monkey/configuration.rb', line 16 def logger @logger end |
#options ⇒ Object
Returns the value of attribute options.
15 16 17 |
# File 'lib/typescript/monkey/configuration.rb', line 15 def @options end |
Instance Method Details
#compile=(value) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/typescript/monkey/configuration.rb', line 35 def compile=(value) unless (!!value == value) raise TypeError, "#{method(__method__).owner}.#{__method__}: value parameter must be type Bool" end if value == true @options.delete("--noResolve") @compile = true else @options.add("--noResolve") @compile = false end end |
#default_options ⇒ Object
31 32 33 |
# File 'lib/typescript/monkey/configuration.rb', line 31 def @_default_options.to_enum end |