Class: Hanami::CLI::Commands::Context Private

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/hanami/cli/commands.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

CLI command context

Since:

  • 1.1.0

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Context

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Context.

Since:

  • 1.1.0



66
67
68
69
70
71
72
73
74
# File 'lib/hanami/cli/commands.rb', line 66

def initialize(data)
  data = data.each_with_object({}) do |(k, v), result|
    v = Utils::String.new(v) if v.is_a?(::String)
    result[k] = v
  end

  super(data)
  freeze
end

Instance Method Details

#bindingObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 1.1.0



84
85
86
# File 'lib/hanami/cli/commands.rb', line 84

def binding
  super
end

#with(data) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 1.1.0



78
79
80
# File 'lib/hanami/cli/commands.rb', line 78

def with(data)
  self.class.new(to_h.merge(data))
end