Class: TreasureData::AggregationSchema

Inherits:
Model
  • Object
show all
Defined in:
lib/td/client/model.rb

Instance Attribute Summary collapse

Attributes inherited from Model

#client

Instance Method Summary collapse

Constructor Details

#initialize(client, name, relation_key, logs = nil, attributes = nil, timezone = nil) ⇒ AggregationSchema

Returns a new instance of AggregationSchema.



516
517
518
519
520
521
522
523
# File 'lib/td/client/model.rb', line 516

def initialize(client, name, relation_key, logs=nil, attributes=nil, timezone=nil)
  super(client)
  @name = name
  @relation_key = relation_key
  @logs = logs
  @attributes = attributes
  @timezone = timezone
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



525
526
527
# File 'lib/td/client/model.rb', line 525

def name
  @name
end

#relation_keyObject (readonly)

Returns the value of attribute relation_key.



525
526
527
# File 'lib/td/client/model.rb', line 525

def relation_key
  @relation_key
end

#timezoneObject (readonly)

Returns the value of attribute timezone.



525
526
527
# File 'lib/td/client/model.rb', line 525

def timezone
  @timezone
end

Instance Method Details

#attributesObject



532
533
534
535
# File 'lib/td/client/model.rb', line 532

def attributes
  update_entries! unless @attributes
  @attributes
end

#logsObject



527
528
529
530
# File 'lib/td/client/model.rb', line 527

def logs
  update_entries! unless @logs
  @logs
end

#update_entries!Object



537
538
539
540
541
542
543
# File 'lib/td/client/model.rb', line 537

def update_entries!
  sc = @client.aggregation_schema(@name)
  @relation_key = sc.relation_key
  @logs = sc.logs
  @attributes = sc.attributes
  self
end