Class: Shirtsio::Endpoint

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

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ Endpoint

Returns a new instance of Endpoint.



2
3
4
# File 'lib/shirtsio/endpoint.rb', line 2

def initialize(json)
  @mash = Hashie::Mash.new(json)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



6
7
8
9
# File 'lib/shirtsio/endpoint.rb', line 6

def method_missing(method, *args, &block)
  return super unless @mash.respond_to?(method)
  @mash.send(method, *args, &block)
end

Instance Method Details

#respond_to?(method) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/shirtsio/endpoint.rb', line 11

def respond_to?(method)
  @mash.respond_to?(method)
end