Class: Most::Report
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#specs ⇒ Object
Returns the value of attribute specs.
-
#units ⇒ Object
Returns the value of attribute units.
Instance Method Summary collapse
- #add_entry(entry) ⇒ Object (also: #<<)
- #delete_entry(entry) ⇒ Object (also: #delete)
- #delete_entry_at(index) ⇒ Object (also: #delete_at)
- #first_entry ⇒ Object (also: #first)
- #first_entry=(entry) ⇒ Object (also: #first=)
- #get_entry(index) ⇒ Object (also: #[])
-
#initialize(name = 'Untitled Report', specs = {}) ⇒ Report
constructor
A new instance of Report.
- #last_entry ⇒ Object (also: #last)
- #last_entry=(entry) ⇒ Object (also: #last=)
- #set_entry(index, value) ⇒ Object (also: #[]=)
- #to_s ⇒ Object (also: #text)
Constructor Details
#initialize(name = 'Untitled Report', specs = {}) ⇒ Report
Returns a new instance of Report.
26 27 28 29 30 31 |
# File 'lib/most/structures/types/report.rb', line 26 def initialize(name = 'Untitled Report', specs = {}) @name = name @specs = specs @units = [] end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
24 25 26 |
# File 'lib/most/structures/types/report.rb', line 24 def name @name end |
#specs ⇒ Object
Returns the value of attribute specs.
24 25 26 |
# File 'lib/most/structures/types/report.rb', line 24 def specs @specs end |
#units ⇒ Object
Returns the value of attribute units.
24 25 26 |
# File 'lib/most/structures/types/report.rb', line 24 def units @units end |
Instance Method Details
#add_entry(entry) ⇒ Object Also known as: <<
33 34 35 |
# File 'lib/most/structures/types/report.rb', line 33 def add_entry(entry) @units << entry end |
#delete_entry(entry) ⇒ Object Also known as: delete
48 49 50 |
# File 'lib/most/structures/types/report.rb', line 48 def delete_entry(entry) @units.delete(entry) end |
#delete_entry_at(index) ⇒ Object Also known as: delete_at
53 54 55 |
# File 'lib/most/structures/types/report.rb', line 53 def delete_entry_at(index) @units.delete_at(index) end |
#first_entry ⇒ Object Also known as: first
58 59 60 |
# File 'lib/most/structures/types/report.rb', line 58 def first_entry() @units.first end |
#first_entry=(entry) ⇒ Object Also known as: first=
63 64 65 |
# File 'lib/most/structures/types/report.rb', line 63 def first_entry=(entry) @units.first = entry end |
#get_entry(index) ⇒ Object Also known as: []
38 39 40 |
# File 'lib/most/structures/types/report.rb', line 38 def get_entry(index) @units[index] end |
#last_entry ⇒ Object Also known as: last
68 69 70 |
# File 'lib/most/structures/types/report.rb', line 68 def last_entry() @units.last end |
#last_entry=(entry) ⇒ Object Also known as: last=
73 74 75 |
# File 'lib/most/structures/types/report.rb', line 73 def last_entry=(entry) @units.last = entry end |
#set_entry(index, value) ⇒ Object Also known as: []=
43 44 45 |
# File 'lib/most/structures/types/report.rb', line 43 def set_entry(index, value) @units[index] = value end |
#to_s ⇒ Object Also known as: text
78 79 80 |
# File 'lib/most/structures/types/report.rb', line 78 def to_s() to_yaml() end |