Class: AccessibleSeedYaml::Record
- Inherits:
-
Object
- Object
- AccessibleSeedYaml::Record
- Defined in:
- lib/accessible_seed_yaml/record.rb
Overview
This class is wrapper of seed for one record.
Functions:
- Fetch seed attributes by hash.
- Stored original seed string. It can fetch anytime.
Instance Attribute Summary collapse
-
#original_seed ⇒ Object
readonly
Returns the value of attribute original_seed.
Instance Method Summary collapse
-
#attributes ⇒ Hash
Attributes of seed data by hash.
-
#initialize(seed_for_one_record) ⇒ Record
constructor
A new instance of Record.
-
#key ⇒ String
Record key.
-
#to_s ⇒ String
This record data by yaml string.
Constructor Details
#initialize(seed_for_one_record) ⇒ Record
Returns a new instance of Record.
32 33 34 35 |
# File 'lib/accessible_seed_yaml/record.rb', line 32 def initialize(seed_for_one_record) @original_seed = seed_for_one_record exchange_to_hash end |
Instance Attribute Details
#original_seed ⇒ Object (readonly)
Returns the value of attribute original_seed.
8 9 10 |
# File 'lib/accessible_seed_yaml/record.rb', line 8 def original_seed @original_seed end |
Instance Method Details
#attributes ⇒ Hash
Returns attributes of seed data by hash.
46 47 48 |
# File 'lib/accessible_seed_yaml/record.rb', line 46 def attributes @seed_data_by_hash.values.first end |
#key ⇒ String
Returns record key.
59 60 61 |
# File 'lib/accessible_seed_yaml/record.rb', line 59 def key @seed_data_by_hash.keys.first end |
#to_s ⇒ String
Returns this record data by yaml string.
70 71 72 |
# File 'lib/accessible_seed_yaml/record.rb', line 70 def to_s self.original_seed end |