Class: Type
- Inherits:
-
Object
- Object
- Type
- Defined in:
- lib/java_testing_guff/qdox_extensions.rb
Instance Method Summary collapse
- #add_takes_clause_to(method_builder) ⇒ Object
- #add_throws_clause_to(method_builder) ⇒ Object
- #any_old_permitted_value ⇒ Object
- #boolean? ⇒ Boolean
- #fully_qualified_name ⇒ Object
- #fully_qualified_type ⇒ Object
- #name ⇒ Object
- #one_of?(*possibles) ⇒ Boolean
- #partial_number? ⇒ Boolean
- #whole_number? ⇒ Boolean
Instance Method Details
#add_takes_clause_to(method_builder) ⇒ Object
156 157 158 |
# File 'lib/java_testing_guff/qdox_extensions.rb', line 156 def add_takes_clause_to(method_builder) method_builder.takes(name, fully_qualified_name) end |
#add_throws_clause_to(method_builder) ⇒ Object
164 165 166 |
# File 'lib/java_testing_guff/qdox_extensions.rb', line 164 def add_throws_clause_to(method_builder) method_builder.throws(fully_qualified_name) end |
#any_old_permitted_value ⇒ Object
168 169 170 171 172 173 174 175 176 177 178 |
# File 'lib/java_testing_guff/qdox_extensions.rb', line 168 def any_old_permitted_value if (boolean?) return "true" elsif (whole_number?) return "0" elsif (partial_number?) return "0.0" else return "null" end end |
#boolean? ⇒ Boolean
128 129 130 |
# File 'lib/java_testing_guff/qdox_extensions.rb', line 128 def boolean? one_of?("boolean", 'java.lang.boolean') end |
#fully_qualified_name ⇒ Object
144 145 146 147 148 149 150 |
# File 'lib/java_testing_guff/qdox_extensions.rb', line 144 def fully_qualified_name result = java_class.fully_qualified_name.gsub("$", ".") if (result.size == 1 && result == result.upcase) result = "Object" end result end |
#fully_qualified_type ⇒ Object
152 153 154 |
# File 'lib/java_testing_guff/qdox_extensions.rb', line 152 def fully_qualified_type fully_qualified_name end |
#name ⇒ Object
160 161 162 |
# File 'lib/java_testing_guff/qdox_extensions.rb', line 160 def name "result" end |
#one_of?(*possibles) ⇒ Boolean
132 133 134 |
# File 'lib/java_testing_guff/qdox_extensions.rb', line 132 def one_of?(*possibles) possibles.include?(to_string.downcase) end |
#partial_number? ⇒ Boolean
140 141 142 |
# File 'lib/java_testing_guff/qdox_extensions.rb', line 140 def partial_number? one_of?("float", 'java.lang.float', 'double', 'java.lang.double') end |
#whole_number? ⇒ Boolean
136 137 138 |
# File 'lib/java_testing_guff/qdox_extensions.rb', line 136 def whole_number? one_of?("long", 'java.lang.long', 'int', 'java.lang.integer') end |