Class: Backend
- Inherits:
-
Object
- Object
- Backend
- Defined in:
- lib/Backend.rb
Instance Attribute Summary collapse
-
#output_array ⇒ Object
readonly
Returns the value of attribute output_array.
Instance Method Summary collapse
- #delete_symbol(str) ⇒ Object
-
#initialize(origin) ⇒ Backend
constructor
A new instance of Backend.
-
#store_code_for_declar_backend ⇒ Object
ELBを参照する際に,hostが一意に定まらない問題.
Constructor Details
#initialize(origin) ⇒ Backend
Returns a new instance of Backend.
3 4 5 6 7 8 |
# File 'lib/Backend.rb', line 3 def initialize(origin) @name = delete_symbol(origin.id) @host = origin.domain_name @port = origin.custom_origin_config.http_port @output_array = Array.new end |
Instance Attribute Details
#output_array ⇒ Object (readonly)
Returns the value of attribute output_array.
2 3 4 |
# File 'lib/Backend.rb', line 2 def output_array @output_array end |
Instance Method Details
#delete_symbol(str) ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/Backend.rb', line 18 def delete_symbol(str) result_str = "" for i in 1..str.size if str[i-1] == "." || str[i-1] == "-" else result_str = result_str + str[i-1] end end return result_str end |
#store_code_for_declar_backend ⇒ Object
ELBを参照する際に,hostが一意に定まらない問題
11 12 13 14 15 16 |
# File 'lib/Backend.rb', line 11 def store_code_for_declar_backend @output_array.push("backend #{@name} {") @output_array.push(" .host = \"#{@host}\";") @output_array.push(" .port = \"#{@port}\";") @output_array.push("}") end |