Class: PopIt::Chain

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass, chain) ⇒ Chain

Returns a new instance of Chain.



162
163
164
165
# File 'lib/popit.rb', line 162

def initialize(klass, chain)
  @klass = klass
  @chain = chain
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args) ⇒ Object



183
184
185
186
# File 'lib/popit.rb', line 183

def method_missing(*args)
  @chain += args
  self
end

Instance Attribute Details

#chainObject (readonly)

Returns the value of attribute chain.



160
161
162
# File 'lib/popit.rb', line 160

def chain
  @chain
end

#klassObject (readonly)

Returns the value of attribute klass.



160
161
162
# File 'lib/popit.rb', line 160

def klass
  @klass
end

Instance Method Details

#delete(opts = {}) ⇒ Object



179
180
181
# File 'lib/popit.rb', line 179

def delete(opts = {})
  @klass.delete(chain.join('/'), opts)
end

#get(opts = {}) ⇒ Object



167
168
169
# File 'lib/popit.rb', line 167

def get(opts = {})
  @klass.get(chain.join('/'), opts)
end

#post(opts = {}) ⇒ Object



171
172
173
# File 'lib/popit.rb', line 171

def post(opts = {})
  @klass.post(chain.join('/'), opts)
end

#put(opts = {}) ⇒ Object



175
176
177
# File 'lib/popit.rb', line 175

def put(opts = {})
  @klass.put(chain.join('/'), opts)
end