Class: Koltira::Operation::Output
- Inherits:
-
Object
- Object
- Koltira::Operation::Output
- Defined in:
- lib/koltira/operation.rb
Overview
output operation class
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #as_json(*args) ⇒ Object
-
#initialize(data = {}) ⇒ Output
constructor
A new instance of Output.
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(data = {}) ⇒ Output
Returns a new instance of Output.
39 40 41 42 43 44 45 |
# File 'lib/koltira/operation.rb', line 39 def initialize(data = {}) unless data.is_a?(Hash) raise ArgumentError, "Hash expected, got: #{data.class}" end @data = data end |
Instance Method Details
#[](key) ⇒ Object
47 48 49 |
# File 'lib/koltira/operation.rb', line 47 def [](key) @data[key] end |
#[]=(key, value) ⇒ Object
51 52 53 |
# File 'lib/koltira/operation.rb', line 51 def []=(key, value) @data[key] = value end |
#as_json(*args) ⇒ Object
59 60 61 |
# File 'lib/koltira/operation.rb', line 59 def as_json(*args) @data.as_json(*args) end |
#to_json(*args) ⇒ Object
55 56 57 |
# File 'lib/koltira/operation.rb', line 55 def to_json(*args) @data.to_json(*args) end |