Class: Rack::RPC::Command
- Inherits:
-
Object
- Object
- Rack::RPC::Command
- Defined in:
- lib/rack/rpc/server.rb
Overview
Server
Direct Known Subclasses
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #callable?(method) ⇒ Boolean
-
#initialize(options) ⇒ Command
constructor
A new instance of Command.
Constructor Details
#initialize(options) ⇒ Command
Returns a new instance of Command.
76 77 78 79 80 81 82 83 |
# File 'lib/rack/rpc/server.rb', line 76 def initialize() @options = # Convert non-array options to arrays [:only, :except].each do |option| [option] = [[option]] if ![option].nil? && ![option].is_a?(Array) end end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
74 75 76 |
# File 'lib/rack/rpc/server.rb', line 74 def @options end |
Instance Method Details
#callable?(method) ⇒ Boolean
85 86 87 88 89 |
# File 'lib/rack/rpc/server.rb', line 85 def callable?(method) .empty? || (![:only].nil? && [:only].include?(method)) || (![:except].nil? && ![:except].include?(method)) end |