Class: TrackedNetwork

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/skynet-core/db/ibrands.rb

Instance Method Summary collapse

Instance Method Details

#mining_is_not_ok!Object



63
64
65
66
# File 'lib/skynet-core/db/ibrands.rb', line 63

def mining_is_not_ok!
  self.state = 'registred' if self.state == 'in_processing'
  self.save
end

#mining_is_ok!Object



54
55
56
57
# File 'lib/skynet-core/db/ibrands.rb', line 54

def mining_is_ok!
  self.state = 'passive' if self.state == 'in_processing'
  self.save
end

#passive?Boolean

Returns:

  • (Boolean)


59
60
61
# File 'lib/skynet-core/db/ibrands.rb', line 59

def passive?
  self.state == 'passive'
end

#processing!Object



45
46
47
48
# File 'lib/skynet-core/db/ibrands.rb', line 45

def processing!
  self.state = 'in_processing' if self.state == 'passive'
  self.save
end

#processing?Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/skynet-core/db/ibrands.rb', line 50

def processing?
  self.state == 'in_processing'
end

#sievesObject



68
69
70
# File 'lib/skynet-core/db/ibrands.rb', line 68

def sieves
  @sieves ||= Sieve.by_brand self.brand_id
end