Module: Octo::Segmentation::ClassMethods

Defined in:
lib/octocore-cassandra/segment.rb

Overview

Extend

Instance Method Summary collapse

Instance Method Details

#all_segment_choicesObject

Returns all possible segment choices. Segment choices are the first

data point that is picked on top of which segment would be made. It
could be one of the supported octo events (eg: app.init etc) or users


253
254
255
# File 'lib/octocore-cassandra/segment.rb', line 253

def all_segment_choices
  valid_events << :users
end

#is_valid_segment(segment) ⇒ Boolean

Returns a boolean specifying if the segment is a valid choice or not

Parameters:

  • segment (String)

    The string to be evaluated

Returns:

  • (Boolean)

    If the provided string exists in valid choices



246
247
248
# File 'lib/octocore-cassandra/segment.rb', line 246

def is_valid_segment segment
  all_segment_choices.include?segment
end