Class: Protor::EntryFamily
- Inherits:
-
Object
- Object
- Protor::EntryFamily
- Defined in:
- lib/protor/entry_family.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #[](label) ⇒ Object
- #[]=(label, value) ⇒ Object
- #each ⇒ Object
-
#initialize(name, type) ⇒ EntryFamily
constructor
A new instance of EntryFamily.
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
#data ⇒ Object (readonly)
Returns the value of attribute data.
3 4 5 |
# File 'lib/protor/entry_family.rb', line 3 def data @data end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/protor/entry_family.rb', line 3 def name @name end |
#type ⇒ Object (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 |
#each ⇒ Object
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 |