Class: Shortwave::Facade::Build::RubyMethod

Inherits:
Object
  • Object
show all
Defined in:
lib/shortwave/facade/build/facade_builder.rb

Overview

A ruby method in a RemoteFacade that will be generated

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ RubyMethod

Returns a new instance of RubyMethod.



79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/shortwave/facade/build/facade_builder.rb', line 79

def initialize(node)
  @comment = []
  @body = []
  @node = node
  @parameters = node.parameters || []
  @required, @optional = (@parameters).partition {|p| p.required? }
  @required.reject! {|p| [:api_key, :api_sig, :sk].include?(p.name) }

  build_comment
  build_signature
  build_body
  self
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



77
78
79
# File 'lib/shortwave/facade/build/facade_builder.rb', line 77

def body
  @body
end

#commentObject (readonly)

Returns the value of attribute comment.



77
78
79
# File 'lib/shortwave/facade/build/facade_builder.rb', line 77

def comment
  @comment
end

#nameObject (readonly)

Returns the value of attribute name.



77
78
79
# File 'lib/shortwave/facade/build/facade_builder.rb', line 77

def name
  @name
end

#signatureObject

Returns the value of attribute signature.



76
77
78
# File 'lib/shortwave/facade/build/facade_builder.rb', line 76

def signature
  @signature
end