Module: Checked::Obj::Base

Included in:
Checked::Obj
Defined in:
lib/Checked/DSL.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#appObject

Returns the value of attribute app.



44
45
46
# File 'lib/Checked/DSL.rb', line 44

def app
  @app
end

#mapObject

Returns the value of attribute map.



44
45
46
# File 'lib/Checked/DSL.rb', line 44

def map
  @map
end

#nameObject

Returns the value of attribute name.



44
45
46
# File 'lib/Checked/DSL.rb', line 44

def name
  @name
end

#valueObject

Returns the value of attribute value.



44
45
46
# File 'lib/Checked/DSL.rb', line 44

def value
  @value
end

Instance Method Details

#<<(checked) ⇒ Object



52
53
54
55
# File 'lib/Checked/DSL.rb', line 52

def << checked
  on! checked.map
  self.name = checked.name
end

#get!(meth_name, *args) ⇒ Object



75
76
77
78
# File 'lib/Checked/DSL.rb', line 75

def get! meth_name, *args
  self.app = Checked::App.new
  app.get!("/#{map}/#{meth_name}", 'name'=>name, 'value'=>value, 'args'=>args)
end

#initializeObject



46
47
48
49
50
# File 'lib/Checked/DSL.rb', line 46

def initialize
  off!
  self.map  = nil
  self.name = nil
end

#off!Object



71
72
73
# File 'lib/Checked/DSL.rb', line 71

def off!
  @on = false
end

#off?Boolean

Returns:

  • (Boolean)


67
68
69
# File 'lib/Checked/DSL.rb', line 67

def off?
  !@on
end

#on!(new_map) ⇒ Object

Raises:

  • (ArgumentError)


61
62
63
64
65
# File 'lib/Checked/DSL.rb', line 61

def on! new_map
  raise ArgumentError, "Map value unacceptable: #{new_map.inspect}" unless new_map
  self.map = new_map
  @on = true
end

#on?Boolean

Returns:

  • (Boolean)


57
58
59
# File 'lib/Checked/DSL.rb', line 57

def on?
  @on
end