Class: PowerBI::Refresh

Inherits:
Object
  • Object
show all
Defined in:
lib/power-bi/refresh.rb

Instance Attribute Summary collapse

Attributes inherited from Object

#id

Instance Method Summary collapse

Methods inherited from Object

instantiate_from_data, #reload, #set_attributes

Constructor Details

#initialize(tenant, parent, id = nil) ⇒ Refresh

Returns a new instance of Refresh.



5
6
7
8
# File 'lib/power-bi/refresh.rb', line 5

def initialize(tenant, parent, id = nil)
  super(tenant, id)
  @dataset = parent
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class PowerBI::Object

Instance Attribute Details

#datasetObject (readonly)

Returns the value of attribute dataset.



3
4
5
# File 'lib/power-bi/refresh.rb', line 3

def dataset
  @dataset
end

Instance Method Details

#data_to_attributes(data) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/power-bi/refresh.rb', line 10

def data_to_attributes(data)
  {
    id: data[:id],
    refresh_type: data[:refreshType],
    start_time: DateTime.iso8601(data[:startTime]),
    end_time: data[:endTime] ? DateTime.iso8601(data[:endTime]) : nil,
    service_exception_json: data[:serviceExceptionJson],
    status: data[:status],
    request_id: data[:requestId],
  }
end