Class: CfScript::Scope::App
- Extended by:
- Forwardable
- Defined in:
- lib/cf_script/scope/app.rb,
lib/cf_script/scope/app.rb
Defined Under Namespace
Modules: Env, Routes, State, Utils
Constant Summary
Constants included from UI
UI::COLORS, UI::EMOJI, UI::TAGS
Instance Attribute Summary collapse
-
#app_info ⇒ Object
readonly
Returns the value of attribute app_info.
-
#current_target ⇒ Object
readonly
Returns the value of attribute current_target.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #current_space ⇒ Object
-
#initialize(name_or_info, current_target) ⇒ App
constructor
A new instance of App.
- #name_tag ⇒ Object
- #tag_color(type = nil) ⇒ Object
Methods included from Utils
Methods included from Routes
#has_route?, #map_route, #unmap_route
Methods included from Env
Methods included from State
#push, #restage, #restart, #restart_instance, #scale, #start, #stop
Methods included from UI::NameTag
#alert, #detail, #error, #info, #progress, #step, #success, #title
Methods included from UI
alert, call_type, debug, detail, emoji, emoji_for, error, info, print_err, print_out, progress, puts_err, puts_out, step, success, tag_char, tag_close, tag_color, tag_format, tag_open, tag_style, title, trace, ui_format, with_color_of
Methods inherited from Base
#finalize, #method_missing, #spec_for
Methods included from Execution
Constructor Details
#initialize(name_or_info, current_target) ⇒ App
Returns a new instance of App.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/cf_script/scope/app.rb', line 14 def initialize(name_or_info, current_target) @current_target = current_target case name_or_info when String, Symbol @name = name_or_info @app_info = nil when CfScript::AppInfo @name = name_or_info.name @app_info = name_or_info else raise "App accepts a name (String or Symbol) or an AppInfo object, " + "but a #{name_or_info.class.name} was given" end cf_self end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class CfScript::Scope::Base
Instance Attribute Details
#app_info ⇒ Object (readonly)
Returns the value of attribute app_info.
8 9 10 |
# File 'lib/cf_script/scope/app.rb', line 8 def app_info @app_info end |
#current_target ⇒ Object (readonly)
Returns the value of attribute current_target.
9 10 11 |
# File 'lib/cf_script/scope/app.rb', line 9 def current_target @current_target end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/cf_script/scope/app.rb', line 7 def name @name end |
Instance Method Details
#current_space ⇒ Object
36 37 38 |
# File 'lib/cf_script/scope/app.rb', line 36 def current_space current_target.space end |
#name_tag ⇒ Object
44 45 46 |
# File 'lib/cf_script/scope/app.rb', line 44 def name_tag "#{current_target.space}:#{name}" end |
#tag_color(type = nil) ⇒ Object
40 41 42 |
# File 'lib/cf_script/scope/app.rb', line 40 def tag_color(type = nil) started? ? :active : :inactive end |