Class: CastCaster::Engines::Base
- Inherits:
-
Object
- Object
- CastCaster::Engines::Base
- Defined in:
- lib/castcaster/engines/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #config_file ⇒ Object
- #config_preview ⇒ Object
- #hls_dir ⇒ Object
-
#initialize(name, config) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(name, config) ⇒ Base
Returns a new instance of Base.
18 19 20 21 |
# File 'lib/castcaster/engines/base.rb', line 18 def initialize(name, config) @name = name @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
16 17 18 |
# File 'lib/castcaster/engines/base.rb', line 16 def config @config end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
16 17 18 |
# File 'lib/castcaster/engines/base.rb', line 16 def name @name end |
Instance Method Details
#config_file ⇒ Object
28 29 30 31 |
# File 'lib/castcaster/engines/base.rb', line 28 def config_file project = @config.fetch('project_dir', Dir.pwd) File.join(project, 'nginx', "#{name}.conf") end |
#config_preview ⇒ Object
23 24 25 26 |
# File 'lib/castcaster/engines/base.rb', line 23 def config_preview generate_config File.read(config_file) end |
#hls_dir ⇒ Object
33 34 35 |
# File 'lib/castcaster/engines/base.rb', line 33 def hls_dir @config.fetch('hls_dir', File.join(project_dir, 'hls')) end |