spec/shapewear/service_definitions/complete_service.rb in shapewear-0.1.2 vs spec/shapewear/service_definitions/complete_service.rb in shapewear-0.1.4
- old
+ new
@@ -19,11 +19,11 @@
operation :get_structured_data, :documentation => 'Returns structured data. 0 uses a Hash, 1 uses a struct, any other value raises a fault',
:parameters => [[:id, Fixnum]],
:returns => {:text => String, :random_value => Fixnum, :created_at => DateTime}
def echo_in_uppercase(text)
- text.upcase
+ text.upcase unless text.nil?
end
def sum(x, y)
x + y
end
@@ -37,10 +37,12 @@
else
raise "ID must be 0 or 1"
end
end
- class Structured < Struct.new(:text, :random_value, :created_at)
+ class Structured
+ attr_reader :text, :random_value, :created_at
+
def initialize(text)
@text = text
@random_value = rand(999)
@created_at = DateTime.now
end