class Environment

Public Instance Methods

as_text() click to toggle source
# File lib/busbar_cli/models/environment.rb, line 18
def as_text
  "App: #{app_id}\n" \
  "Environment: #{name}\n" \
  "Namespace: #{namespace}\n" \
  "--\n" \
  "Buildpack ID: #{buildpack_id}\n" \
  "State: #{state}\n" \
  "Public?: #{public}\n" \
  "Default Branch: #{default_branch}\n" \
  "Default Node ID: #{default_node_id}\n" \
  "Settings: \n#{pretty_settings}\n" \
  "Components: \n#{pretty_components}\n" \
  "Created_at: #{created_at}\n" \
  "Updated_at: #{updated_at}"
end

Private Instance Methods

pretty_components() click to toggle source
# File lib/busbar_cli/models/environment.rb, line 42
def pretty_components
  components.sort_by(&:first).map do |component|
    component.map do |attribute, value|
      "\t#{attribute}: #{value}"
    end.join("\n")
  end.join("\n\t--\n")
end
pretty_settings() click to toggle source
# File lib/busbar_cli/models/environment.rb, line 36
def pretty_settings
  settings.sort.map do |setting, value|
    "\t#{setting}: #{value}"
  end.join("\n")
end