Class: Atoms::Endpoint

Inherits:
Object
  • Object
show all
Defined in:
lib/atoms.rb

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Class Attribute Details

.blockObject

Returns the value of attribute block.



108
109
110
# File 'lib/atoms.rb', line 108

def block
  @block
end

.headerObject

Returns the value of attribute header.



108
109
110
# File 'lib/atoms.rb', line 108

def header
  @header
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



95
96
97
# File 'lib/atoms.rb', line 95

def params
  @params
end

Class Method Details

.call(prms) ⇒ Object



119
120
121
# File 'lib/atoms.rb', line 119

def call(prms)
  new.call(prms)
end

.generate(header, &block) ⇒ Object



110
111
112
113
114
115
116
117
# File 'lib/atoms.rb', line 110

def generate(header, &block)
  c = Class.new(Atoms::Endpoint)
  c.class_eval do
    @header = header
    @block = block
  end
  c
end

Instance Method Details

#call(prms) ⇒ Object



101
102
103
104
# File 'lib/atoms.rb', line 101

def call(prms)
  @params = prms
  response = instance_eval &self.class.block
end