Class: Spikard::Introspection::Binding

Inherits:
Object
  • Object
show all
Defined in:
lib/spikard/introspection.rb

Overview

Resolved binding for a single non-body handler parameter.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, source, target_type, param_default) ⇒ Binding

Returns a new instance of Binding.



17
18
19
20
21
22
# File 'lib/spikard/introspection.rb', line 17

def initialize(name, source, target_type, param_default)
  @name = name
  @source = source
  @target_type = target_type
  @param_default = param_default
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



15
16
17
# File 'lib/spikard/introspection.rb', line 15

def name
  @name
end

#param_defaultObject (readonly)

Returns the value of attribute param_default.



15
16
17
# File 'lib/spikard/introspection.rb', line 15

def param_default
  @param_default
end

#sourceObject (readonly)

Returns the value of attribute source.



15
16
17
# File 'lib/spikard/introspection.rb', line 15

def source
  @source
end

#target_typeObject (readonly)

Returns the value of attribute target_type.



15
16
17
# File 'lib/spikard/introspection.rb', line 15

def target_type
  @target_type
end

Instance Method Details

#has_plain_default?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/spikard/introspection.rb', line 24

def has_plain_default?
  @param_default && !@param_default.is_a?(ParamBase)
end