Class: Bridgetown::Drops::BridgetownDrop

Inherits:
Liquid::Drop
  • Object
show all
Defined in:
bridgetown-core/lib/bridgetown-core/drops/bridgetown_drop.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.globalObject



7
8
9
# File 'bridgetown-core/lib/bridgetown-core/drops/bridgetown_drop.rb', line 7

def global
  @global ||= BridgetownDrop.new
end

Instance Method Details

#code_nameObject



16
17
18
# File 'bridgetown-core/lib/bridgetown-core/drops/bridgetown_drop.rb', line 16

def code_name
  Bridgetown::CODE_NAME
end

#environmentObject



20
21
22
# File 'bridgetown-core/lib/bridgetown-core/drops/bridgetown_drop.rb', line 20

def environment
  Bridgetown.environment
end

#to_hObject



24
25
26
27
28
29
30
# File 'bridgetown-core/lib/bridgetown-core/drops/bridgetown_drop.rb', line 24

def to_h
  @to_h ||= {
    "version"     => version,
    "code_name"   => code_name,
    "environment" => environment,
  }
end

#to_json(state = nil) ⇒ Object



32
33
34
# File 'bridgetown-core/lib/bridgetown-core/drops/bridgetown_drop.rb', line 32

def to_json(state = nil)
  JSON.generate(to_h, state)
end

#versionObject



12
13
14
# File 'bridgetown-core/lib/bridgetown-core/drops/bridgetown_drop.rb', line 12

def version
  Bridgetown::VERSION
end