Class: Radar::API::Result

Inherits:
Thrift::Union
  • Object
show all
Includes:
Thrift::Struct_Union
Defined in:
lib/radar/api/radar_types.rb

Constant Summary collapse

TABLE =
1
PIE_CHART =
2
LINE_CHART =
3
BAR_CHART =
4
FIELDS =
{
  TABLE => {:type => ::Thrift::Types::STRUCT, :name => 'table', :class => ::Radar::API::Table},
  PIE_CHART => {:type => ::Thrift::Types::STRUCT, :name => 'pie_chart', :class => ::Radar::API::PieChart},
  LINE_CHART => {:type => ::Thrift::Types::STRUCT, :name => 'line_chart', :class => ::Radar::API::LineChart},
  BAR_CHART => {:type => ::Thrift::Types::STRUCT, :name => 'bar_chart', :class => ::Radar::API::BarChart}
}

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.bar_chart(val) ⇒ Object



486
487
488
# File 'lib/radar/api/radar_types.rb', line 486

def bar_chart(val)
  Result.new(:bar_chart, val)
end

.line_chart(val) ⇒ Object



482
483
484
# File 'lib/radar/api/radar_types.rb', line 482

def line_chart(val)
  Result.new(:line_chart, val)
end

.pie_chart(val) ⇒ Object



478
479
480
# File 'lib/radar/api/radar_types.rb', line 478

def pie_chart(val)
  Result.new(:pie_chart, val)
end

.table(val) ⇒ Object



474
475
476
# File 'lib/radar/api/radar_types.rb', line 474

def table(val)
  Result.new(:table, val)
end

Instance Method Details

#struct_fieldsObject



503
# File 'lib/radar/api/radar_types.rb', line 503

def struct_fields; FIELDS; end

#validateObject

Raises:

  • (StandardError)


505
506
507
# File 'lib/radar/api/radar_types.rb', line 505

def validate
  raise(StandardError, 'Union fields are not set.') if get_set_field.nil? || get_value.nil?
end