Class: Logsaber::Entry
- Inherits:
-
Object
- Object
- Logsaber::Entry
- Defined in:
- lib/logsaber/entry.rb
Instance Attribute Summary collapse
-
#primary ⇒ Object
readonly
Returns the value of attribute primary.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(primary, secondary) ⇒ Entry
constructor
A new instance of Entry.
- #parse ⇒ Object
Constructor Details
#initialize(primary, secondary) ⇒ Entry
Returns a new instance of Entry.
8 9 10 |
# File 'lib/logsaber/entry.rb', line 8 def initialize primary, secondary @primary, @secondary = primary, secondary end |
Instance Attribute Details
#primary ⇒ Object (readonly)
Returns the value of attribute primary.
11 12 13 |
# File 'lib/logsaber/entry.rb', line 11 def primary @primary end |
Class Method Details
.create(all_details, &block) ⇒ Object
3 4 5 6 |
# File 'lib/logsaber/entry.rb', line 3 def self.create all_details, &block all_details << block.call if block new all_details.shift, Array(all_details) end |
Instance Method Details
#parse ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/logsaber/entry.rb', line 13 def parse { label: label, info: info, primary: primary, secondary: secondary, object: value } end |