Class: ActionWebService::BaseType
- Inherits:
-
Object
- Object
- ActionWebService::BaseType
- Includes:
- SignatureTypes
- Defined in:
- lib/action_web_service/support/signature_types.rb
Overview
:nodoc:
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#spec ⇒ Object
readonly
Returns the value of attribute spec.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#type_class ⇒ Object
readonly
Returns the value of attribute type_class.
Instance Method Summary collapse
- #array? ⇒ Boolean
- #custom? ⇒ Boolean
- #human_name(show_name = true) ⇒ Object
-
#initialize(spec, type, name) ⇒ BaseType
constructor
A new instance of BaseType.
- #simple? ⇒ Boolean
- #structured? ⇒ Boolean
Methods included from SignatureTypes
canonical_signature, canonical_signature_entry, canonical_type, canonical_type_class, canonical_type_name, class_to_type_name, derived_from?, symbol_name, type_name_to_class
Constructor Details
#initialize(spec, type, name) ⇒ BaseType
Returns a new instance of BaseType.
162 163 164 165 166 167 |
# File 'lib/action_web_service/support/signature_types.rb', line 162 def initialize(spec, type, name) @spec = spec @type = canonical_type(type) @type_class = canonical_type_class(@type) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
160 161 162 |
# File 'lib/action_web_service/support/signature_types.rb', line 160 def name @name end |
#spec ⇒ Object (readonly)
Returns the value of attribute spec.
157 158 159 |
# File 'lib/action_web_service/support/signature_types.rb', line 157 def spec @spec end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
158 159 160 |
# File 'lib/action_web_service/support/signature_types.rb', line 158 def type @type end |
#type_class ⇒ Object (readonly)
Returns the value of attribute type_class.
159 160 161 |
# File 'lib/action_web_service/support/signature_types.rb', line 159 def type_class @type_class end |
Instance Method Details
#array? ⇒ Boolean
173 174 175 |
# File 'lib/action_web_service/support/signature_types.rb', line 173 def array? false end |
#custom? ⇒ Boolean
169 170 171 |
# File 'lib/action_web_service/support/signature_types.rb', line 169 def custom? false end |
#human_name(show_name = true) ⇒ Object
185 186 187 188 189 |
# File 'lib/action_web_service/support/signature_types.rb', line 185 def human_name(show_name=true) type_type = array? ? element_type.type.to_s : self.type.to_s str = array? ? (type_type + '[]') : type_type show_name ? (str + " " + name.to_s) : str end |
#simple? ⇒ Boolean
181 182 183 |
# File 'lib/action_web_service/support/signature_types.rb', line 181 def simple? false end |
#structured? ⇒ Boolean
177 178 179 |
# File 'lib/action_web_service/support/signature_types.rb', line 177 def structured? false end |