Class: Protor::EntryFamily

Inherits:
Object
  • Object
show all
Defined in:
lib/protor/entry_family.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, type) ⇒ EntryFamily

Returns a new instance of EntryFamily.



5
6
7
8
9
# File 'lib/protor/entry_family.rb', line 5

def initialize(name, type)
  @name = name
  @type = type
  @data = {}
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



3
4
5
# File 'lib/protor/entry_family.rb', line 3

def data
  @data
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/protor/entry_family.rb', line 3

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



3
4
5
# File 'lib/protor/entry_family.rb', line 3

def type
  @type
end

Instance Method Details

#[](label) ⇒ Object



15
16
17
# File 'lib/protor/entry_family.rb', line 15

def [](label)
  data[label]
end

#[]=(label, value) ⇒ Object



11
12
13
# File 'lib/protor/entry_family.rb', line 11

def []=(label, value)
  data[label] = value
end

#eachObject



19
20
21
22
23
# File 'lib/protor/entry_family.rb', line 19

def each
  return unless block_given?

  data.each_value{ |d| yield(d) }
end