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)
-
- (void) options
readonly
Returns the value of attribute options.
Instance Method Summary (collapse)
- - (Boolean) callable?(method)
-
- (Command) initialize(options)
constructor
A new instance of Command.
Constructor Details
- (Command) initialize(options)
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
- (void) options (readonly)
Returns the value of attribute options
74 75 76 |
# File 'lib/rack/rpc/server.rb', line 74 def @options end |
Instance Method Details
- (Boolean) callable?(method)
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 |