Class: Mushikago::Mitsubachi::Scripts
- Inherits:
-
Object
- Object
- Mushikago::Mitsubachi::Scripts
- Defined in:
- lib/mushikago/mitsubachi/scripts.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#project_name ⇒ Object
readonly
Returns the value of attribute project_name.
Instance Method Summary collapse
- #[](script_name) ⇒ Object
- #deploy(script_file, options = {}) ⇒ Object
- #each ⇒ Object
-
#initialize(client, project_name) ⇒ Scripts
constructor
A new instance of Scripts.
- #list ⇒ Object
Constructor Details
#initialize(client, project_name) ⇒ Scripts
Returns a new instance of Scripts.
8 9 10 11 |
# File 'lib/mushikago/mitsubachi/scripts.rb', line 8 def initialize client, project_name @client = client @project_name = project_name end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
5 6 7 |
# File 'lib/mushikago/mitsubachi/scripts.rb', line 5 def client @client end |
#project_name ⇒ Object (readonly)
Returns the value of attribute project_name.
6 7 8 |
# File 'lib/mushikago/mitsubachi/scripts.rb', line 6 def project_name @project_name end |
Instance Method Details
#[](script_name) ⇒ Object
13 14 15 |
# File 'lib/mushikago/mitsubachi/scripts.rb', line 13 def [] script_name Mitsubachi::Script.new(client, project_name, script_name) end |
#deploy(script_file, options = {}) ⇒ Object
17 18 19 |
# File 'lib/mushikago/mitsubachi/scripts.rb', line 17 def deploy script_file, ={} client.script_deploy(project_name, script_file, ) end |
#each ⇒ Object
25 26 27 |
# File 'lib/mushikago/mitsubachi/scripts.rb', line 25 def each list.each end |
#list ⇒ Object
21 22 23 |
# File 'lib/mushikago/mitsubachi/scripts.rb', line 21 def list client.script_list(project_name)['scripts'].map{|p| self[p['name']]} end |