Class: ActsAsSpan::SpanInstance
- Inherits:
-
Object
- Object
- ActsAsSpan::SpanInstance
- Includes:
- Status, Validations
- Defined in:
- lib/acts_as_span/span_instance.rb,
lib/acts_as_span/span_instance/status.rb,
lib/acts_as_span/span_instance/validations.rb
Defined Under Namespace
Modules: Status, Validations
Instance Attribute Summary collapse
-
#acts_as_span_definition ⇒ Object
readonly
Returns the value of attribute acts_as_span_definition.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#span_model ⇒ Object
readonly
Returns the value of attribute span_model.
Instance Method Summary collapse
- #end_date ⇒ Object
-
#initialize(name, span_model, acts_as_span_definition) ⇒ SpanInstance
constructor
A new instance of SpanInstance.
- #span_klass ⇒ Object
- #start_date ⇒ Object
Constructor Details
#initialize(name, span_model, acts_as_span_definition) ⇒ SpanInstance
Returns a new instance of SpanInstance.
19 20 21 22 23 |
# File 'lib/acts_as_span/span_instance.rb', line 19 def initialize(name, span_model, acts_as_span_definition) @name = name @span_model = span_model @acts_as_span_definition = acts_as_span_definition end |
Instance Attribute Details
#acts_as_span_definition ⇒ Object (readonly)
Returns the value of attribute acts_as_span_definition.
17 18 19 |
# File 'lib/acts_as_span/span_instance.rb', line 17 def acts_as_span_definition @acts_as_span_definition end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
17 18 19 |
# File 'lib/acts_as_span/span_instance.rb', line 17 def name @name end |
#span_model ⇒ Object (readonly)
Returns the value of attribute span_model.
17 18 19 |
# File 'lib/acts_as_span/span_instance.rb', line 17 def span_model @span_model end |
Instance Method Details
#end_date ⇒ Object
33 34 35 |
# File 'lib/acts_as_span/span_instance.rb', line 33 def end_date span_model[end_field] end |
#span_klass ⇒ Object
25 26 27 |
# File 'lib/acts_as_span/span_instance.rb', line 25 def span_klass @span_klass ||= span_model.class end |
#start_date ⇒ Object
29 30 31 |
# File 'lib/acts_as_span/span_instance.rb', line 29 def start_date span_model[start_field] end |