Class: Farscape::RepresentorAgent
- Inherits:
-
SafeRepresentorAgent
- Object
- SafeRepresentorAgent
- Farscape::RepresentorAgent
- Defined in:
- lib/farscape/representor.rb
Constant Summary
Constants inherited from SafeRepresentorAgent
SafeRepresentorAgent::EMPTY_BODIES
Instance Attribute Summary
Attributes inherited from SafeRepresentorAgent
#agent, #representor, #response
Instance Method Summary collapse
- #method_missing(method, *args, &block) ⇒ Object
- #respond_to_missing?(method_name, include_private = false) ⇒ Boolean
-
#to_ary ⇒ Object
HACK! - Requires for method_missing; apparently an undocumented feature of Ruby.
Methods inherited from SafeRepresentorAgent
#attributes, #embedded, #initialize, #safe, #to_hash, #transitions, #unsafe
Methods included from BaseAgent
Constructor Details
This class inherits a constructor from Farscape::SafeRepresentorAgent
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
74 75 76 77 78 79 |
# File 'lib/farscape/representor.rb', line 74 def method_missing(method, *args, &block) super rescue NoMethodError => e parameters = args.first || {} (method) || get_transition(method, parameters, &block) || get_attribute(method) || raise end |
Instance Method Details
#respond_to_missing?(method_name, include_private = false) ⇒ Boolean
81 82 83 |
# File 'lib/farscape/representor.rb', line 81 def respond_to_missing?(method_name, include_private = false) super || [.include?(method_name), method_transitions.include?(method), attributes.include?(method)].any? end |
#to_ary ⇒ Object
HACK! - Requires for method_missing; apparently an undocumented feature of Ruby
86 87 |
# File 'lib/farscape/representor.rb', line 86 def to_ary end |