Class: JSH::Pair

Inherits:
Object
  • Object
show all
Defined in:
lib/jsh/pair.rb

Direct Known Subclasses

Commands, Hooks

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = nil) ⇒ Pair

Returns a new instance of Pair.



5
6
7
# File 'lib/jsh/pair.rb', line 5

def initialize(data = nil)
  @data = data || default_data
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



3
4
5
# File 'lib/jsh/pair.rb', line 3

def data
  @data
end

Instance Method Details

#[](key) ⇒ Object



9
10
11
# File 'lib/jsh/pair.rb', line 9

def [](key)
  @data[key]
end

#[]=(key, value) ⇒ Object



13
14
15
# File 'lib/jsh/pair.rb', line 13

def []=(key, value)
  @data[key] = value
end

#allObject



17
18
19
# File 'lib/jsh/pair.rb', line 17

def all
  @data
end