Class: MixReader::Base

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/mix_reader/base.rb

Direct Known Subclasses

Events, People

Constant Summary collapse

MIXPANEL_JQL_URL =
"https://mixpanel.com/api/2.0/jql"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Base

Returns a new instance of Base.



18
19
20
21
# File 'lib/mix_reader/base.rb', line 18

def initialize(args)
  raise "can not instantiate base class" if class_name == "Base"
  @filters = args
end

Instance Attribute Details

#filtersObject

Returns the value of attribute filters.



8
9
10
# File 'lib/mix_reader/base.rb', line 8

def filters
  @filters
end

#optionsObject

Returns the value of attribute options.



8
9
10
# File 'lib/mix_reader/base.rb', line 8

def options
  @options
end

#scriptObject

Returns the value of attribute script.



8
9
10
# File 'lib/mix_reader/base.rb', line 8

def script
  @script
end

Class Method Details

.query(args) ⇒ Object



11
12
13
14
15
# File 'lib/mix_reader/base.rb', line 11

def query(args)
  raise "invalid arguments" unless args.is_a?(Hash)

  new(args).query
end

Instance Method Details

#queryObject



23
24
25
26
27
# File 'lib/mix_reader/base.rb', line 23

def query
  build_script
  build_options
  query_and_init_objects
end