Class: OpenAmplify::Analysis::Context
- Inherits:
-
Object
- Object
- OpenAmplify::Analysis::Context
- Defined in:
- lib/openamplify/analysis/context.rb
Constant Summary collapse
- VALID_OPTIONS_KEYS =
OpenAmplify::Configuration::VALID_OPTIONS_KEYS + [:input]
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
-
#empty? ⇒ Boolean
The empty?, to_s, to_str are to make our object play with others that expect a string.
-
#initialize(client, input, options) ⇒ Context
constructor
A new instance of Context.
- #to_s ⇒ Object (also: #to_str)
Constructor Details
#initialize(client, input, options) ⇒ Context
Returns a new instance of Context.
13 14 15 16 17 18 19 20 21 |
# File 'lib/openamplify/analysis/context.rb', line 13 def initialize(client, input, ) self.client = client self.input = input = OpenAmplify..merge() OpenAmplify::Configuration::VALID_OPTIONS_KEYS.each do |key| send("#{key}=", [key]) end end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
10 11 12 |
# File 'lib/openamplify/analysis/context.rb', line 10 def client @client end |
Instance Method Details
#empty? ⇒ Boolean
The empty?, to_s, to_str are to make our object play with others that expect a string.
Example, you can do this:
puts result
instead of:
puts result.to_s
32 33 34 |
# File 'lib/openamplify/analysis/context.rb', line 32 def empty? result.empty? end |
#to_s ⇒ Object Also known as: to_str
36 37 38 |
# File 'lib/openamplify/analysis/context.rb', line 36 def to_s "#{result}" end |