Class: Swiftfake::Presenter

Inherits:
Object
  • Object
show all
Defined in:
lib/swiftfake/presenter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(swift_class) ⇒ Presenter

Returns a new instance of Presenter.



7
8
9
# File 'lib/swiftfake/presenter.rb', line 7

def initialize(swift_class)
  @swift_class = swift_class
end

Instance Attribute Details

#swift_classObject (readonly)

Returns the value of attribute swift_class.



5
6
7
# File 'lib/swiftfake/presenter.rb', line 5

def swift_class
  @swift_class
end

Instance Method Details

#fake_class_signatureObject



15
16
17
# File 'lib/swiftfake/presenter.rb', line 15

def fake_class_signature
  "#{swift_class.access} class Fake#{swift_class.name}: #{swift_class.name}"
end

#functionsObject



19
20
21
# File 'lib/swiftfake/presenter.rb', line 19

def functions
  @functions ||= swift_class.functions.map { |f| f.extend(FunctionDecorator) }
end

#functions_with_argsObject



23
24
25
# File 'lib/swiftfake/presenter.rb', line 23

def functions_with_args
  functions.select(&:has_args?)
end

#functions_with_return_valueObject



27
28
29
# File 'lib/swiftfake/presenter.rb', line 27

def functions_with_return_value
  functions.select(&:returns?)
end

#get_bindingObject



11
12
13
# File 'lib/swiftfake/presenter.rb', line 11

def get_binding
  binding()
end