Class: ActsAsCalculator::ImportOutcome
- Inherits:
-
Data
- Object
- Data
- ActsAsCalculator::ImportOutcome
- Defined in:
- lib/acts_as_calculator/import_outcome.rb
Instance Attribute Summary collapse
-
#detail ⇒ Object
readonly
Returns the value of attribute detail.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#detail ⇒ Object (readonly)
Returns the value of attribute detail
7 8 9 |
# File 'lib/acts_as_calculator/import_outcome.rb', line 7 def detail @detail end |
#key ⇒ Object (readonly)
Returns the value of attribute key
7 8 9 |
# File 'lib/acts_as_calculator/import_outcome.rb', line 7 def key @key end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind
7 8 9 |
# File 'lib/acts_as_calculator/import_outcome.rb', line 7 def kind @kind end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope
7 8 9 |
# File 'lib/acts_as_calculator/import_outcome.rb', line 7 def scope @scope end |
#status ⇒ Object (readonly)
Returns the value of attribute status
7 8 9 |
# File 'lib/acts_as_calculator/import_outcome.rb', line 7 def status @status end |
Class Method Details
.build(kind:, status:, key:, scope:, detail: nil) ⇒ Object
8 9 10 |
# File 'lib/acts_as_calculator/import_outcome.rb', line 8 def self.build(kind:, status:, key:, scope:, detail: nil) new(kind: kind.to_sym, status: status.to_sym, key: key.to_s, scope: scope.to_s, detail:) end |
Instance Method Details
#failed? ⇒ Boolean
12 13 14 |
# File 'lib/acts_as_calculator/import_outcome.rb', line 12 def failed? status == :failed end |
#to_s ⇒ Object
16 17 18 |
# File 'lib/acts_as_calculator/import_outcome.rb', line 16 def to_s "#{status} #{kind} #{key.inspect} (scope #{scope.inspect})#{detail && " — #{detail}"}" end |