Class: Shirtsio::Endpoint
- Inherits:
-
Object
- Object
- Shirtsio::Endpoint
- Defined in:
- lib/shirtsio/endpoint.rb
Direct Known Subclasses
Order, Product, Product::Category, Product::Simple, Quote, Status, Status::Webhook
Instance Method Summary collapse
-
#initialize(json) ⇒ Endpoint
constructor
A new instance of Endpoint.
- #method_missing(method, *args, &block) ⇒ Object
- #respond_to?(method) ⇒ Boolean
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
11 12 13 |
# File 'lib/shirtsio/endpoint.rb', line 11 def respond_to?(method) @mash.respond_to?(method) end |