Method: Radiator::Chain#properties

Defined in:
lib/radiator/chain.rb

#propertiesObject

Current dynamic global properties, cached for 3 seconds. This is useful for reading properties without worrying about actually fetching it over rpc more than needed.



126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/radiator/chain.rb', line 126

def properties
  @properties ||= nil
  
  if !!@properties && Time.now.utc - Time.parse(@properties.time + 'Z') > 3
    @properties = nil
  end
  
  return @properties if !!@properties
  
  api.get_dynamic_global_properties do |properties|
    @properties = properties
  end
end