Class: Bunto::Drops::BuntoDrop

Inherits:
Liquid::Drop
  • Object
show all
Defined in:
lib/bunto/drops/bunto_drop.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.globalObject



7
8
9
# File 'lib/bunto/drops/bunto_drop.rb', line 7

def global
  @global ||= BuntoDrop.new
end

Instance Method Details

#environmentObject



16
17
18
# File 'lib/bunto/drops/bunto_drop.rb', line 16

def environment
  Bunto.env
end

#to_hObject



20
21
22
23
24
25
# File 'lib/bunto/drops/bunto_drop.rb', line 20

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

#to_json(state = nil) ⇒ Object



27
28
29
30
# File 'lib/bunto/drops/bunto_drop.rb', line 27

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

#versionObject



12
13
14
# File 'lib/bunto/drops/bunto_drop.rb', line 12

def version
  Bunto::VERSION
end