Class: Antelope::DSL::Contexts::Terminal

Inherits:
Base
  • Object
show all
Defined in:
lib/antelope/dsl/contexts/terminal.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#options

Instance Method Summary collapse

Methods inherited from Base

#call, #context, #initialize

Constructor Details

This class inherits a constructor from Antelope::DSL::Contexts::Base

Instance Attribute Details

#terminalsObject (readonly, private) Also known as: data

Returns the value of attribute terminals.



19
20
21
# File 'lib/antelope/dsl/contexts/terminal.rb', line 19

def terminals
  @terminals
end

Instance Method Details

#before_callObject (private)



22
23
24
# File 'lib/antelope/dsl/contexts/terminal.rb', line 22

def before_call
  @terminals = {}
end

#terminal(map, value = true) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/antelope/dsl/contexts/terminal.rb', line 5

def terminal(map, value = true)
  case map
  when Hash
    @terminals.merge!(map)
  when Symbol, String
    @terminals[map] = value
  else
    raise ArgumentError, "Unexpected #{map.class}, expected " \
      "Hash or Symbol"
  end
end