Class: Es::DurationField
Constant Summary
Constants inherited from Field
Field::ATTRIBUTE_TYPE, Field::AUTOINCREMENT_TYPE, Field::DATE_TYPE, Field::DURATION_TYPE, Field::FACT_TYPE, Field::FIELD_TYPES, Field::HID_TYPE, Field::HISTORIC_TYPE, Field::IS_DELETED_TYPE, Field::RECORDID_TYPE, Field::SNAPSHOT_TYPE, Field::TIMEATTRIBUTE_TYPE, Field::TIMESTAMP_TYPE, Field::TIME_TYPE, Field::VELOCITY_TYPE
Instance Attribute Summary collapse
-
#attribute ⇒ Object
Returns the value of attribute attribute.
-
#control_attribute ⇒ Object
Returns the value of attribute control_attribute.
-
#name ⇒ Object
Returns the value of attribute name.
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(name, type, options = {}) ⇒ DurationField
constructor
A new instance of DurationField.
- #is_duration? ⇒ Boolean
- #to_extract_fragment(pid, fields, options = {}) ⇒ Object
Methods inherited from Field
#==, #is_attribute?, #is_autoincrement?, #is_date?, #is_fact?, #is_hid?, #is_recordid?, #is_snapshot?, #is_timestamp?, #is_velocity?, parse, #to_config_generator, #to_config_generator_extract, #to_load_config, #to_load_fragment
Constructor Details
#initialize(name, type, options = {}) ⇒ DurationField
Returns a new instance of DurationField.
818 819 820 821 822 823 |
# File 'lib/es.rb', line 818 def initialize(name, type, = {}) super(name, type) @attribute = [:attribute] || "IsClosed" @value = [:value] || "false" @control_attribute = [:control_attribute] || "StageName" end |
Instance Attribute Details
#attribute ⇒ Object
Returns the value of attribute attribute.
816 817 818 |
# File 'lib/es.rb', line 816 def attribute @attribute end |
#control_attribute ⇒ Object
Returns the value of attribute control_attribute.
816 817 818 |
# File 'lib/es.rb', line 816 def control_attribute @control_attribute end |
#name ⇒ Object
Returns the value of attribute name.
816 817 818 |
# File 'lib/es.rb', line 816 def name @name end |
#type ⇒ Object
Returns the value of attribute type.
816 817 818 |
# File 'lib/es.rb', line 816 def type @type end |
#value ⇒ Object
Returns the value of attribute value.
816 817 818 |
# File 'lib/es.rb', line 816 def value @value end |
Instance Method Details
#is_duration? ⇒ Boolean
825 826 827 |
# File 'lib/es.rb', line 825 def is_duration? true end |
#to_extract_fragment(pid, fields, options = {}) ⇒ Object
829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 |
# File 'lib/es.rb', line 829 def to_extract_fragment(pid, fields, = {}) { :name => "StageDuration", :preferred => "stageduration", :definition => { :type => "case", :ops => [{ :type => "option", :ops => [{ :type => "=", :ops => [{ :type => "stream", :data => attribute }, { :type => "match", :data => value }] }, { :type => "duration", :ops => [{ :type => "stream", :data => control_attribute }] }] }, { :type => "option", :ops => [{ :type => "const", :data => 1 }, { :type => "const", :data => 0 }] }] } } end |