Class: Hancock::Consumer

Inherits:
Object
  • Object
show all
Includes:
DataMapper::Resource
Defined in:
lib/models/consumer.rb

Class Method Summary collapse

Class Method Details

.allowed?(host) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/models/consumer.rb', line 9

def self.allowed?(host)
  !first(:url => host).nil?
end

.internalObject



19
20
21
22
23
# File 'lib/models/consumer.rb', line 19

def self.internal
  all(:internal => true).select do |c|
    c.label
  end
end

.visibleObject



13
14
15
16
17
# File 'lib/models/consumer.rb', line 13

def self.visible
  all(:internal => false).select do |c|
    c.label
  end
end