Class: Mushikago::Hanamgri::TrainingData

Inherits:
Object
  • Object
show all
Defined in:
lib/mushikago/hanamgri/training_data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ TrainingData

Returns a new instance of TrainingData.



8
9
10
11
# File 'lib/mushikago/hanamgri/training_data.rb', line 8

def initialize(&block)
  @training_data = {}
  instance_eval(&block) if block_given?
end

Instance Attribute Details

#training_dataObject (readonly)

Returns the value of attribute training_data.



6
7
8
# File 'lib/mushikago/hanamgri/training_data.rb', line 6

def training_data
  @training_data
end

Instance Method Details

#[]=(key, value) ⇒ Object



13
14
15
# File 'lib/mushikago/hanamgri/training_data.rb', line 13

def []= key, value
  @training_data[key] = value
end

#put(key, value) ⇒ Object



17
18
19
# File 'lib/mushikago/hanamgri/training_data.rb', line 17

def put key, value
  @training_data[key] = value
end

#to_json(*args) ⇒ Object



21
22
23
# File 'lib/mushikago/hanamgri/training_data.rb', line 21

def to_json *args
  @training_data.to_json(args)
end