Skip to content

Commit 5837177

Browse files
committed
Merge pull request #98 from cmarkle/rdoc-fix
Fix incorrect rdoc for simple case where sl_attr is specified with two args
2 parents d5e6b4c + 1fdabcd commit 5837177

36 files changed

Lines changed: 258 additions & 147 deletions

lib/softlayer/Account.rb

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ class Account < SoftLayer::ModelBase
5858

5959
##
6060
# :attr_reader:
61-
# The office phone nubmer listed for the primary contact
61+
# The office phone number listed for the primary contact
6262
sl_attr :officePhone
6363

6464
##
65-
# The Bare Metal Servers (physical hardware) associated with the
65+
# Retrieve the Bare Metal Servers (physical hardware) associated with the
6666
# account. Unless you force these to update, they will be refreshed every
6767
# five minutes.
6868
# :call-seq:
@@ -82,6 +82,8 @@ class Account < SoftLayer::ModelBase
8282
##
8383
# Retrieve an account's master EVault user. This is only used when an account
8484
# has an EVault service.
85+
# :call-seq:
86+
# evault_master_users(force_update=false)
8587
sl_dynamic_attr :evault_master_users do |evault_users|
8688
evault_users.should_update? do
8789
@evault_master_users == nil
@@ -94,7 +96,10 @@ class Account < SoftLayer::ModelBase
9496
end
9597

9698
##
97-
# Retrieve an account's image templates
99+
# Retrieve an account's image templates. Unless you force
100+
# these to update, they will be refreshed every five minutes
101+
# :call-seq:
102+
# image_templates(force_update=false)
98103
sl_dynamic_attr :image_templates do |image_templates|
99104
image_templates.should_update? do
100105
@last_image_template_update ||= Time.at(0)
@@ -108,7 +113,9 @@ class Account < SoftLayer::ModelBase
108113
end
109114

110115
##
111-
# Retrieve an account's network message delivery acounts.
116+
# Retrieve an account's network message delivery accounts.
117+
# :call-seq:
118+
# network_message_delivery_accounts(force_update=false)
112119
sl_dynamic_attr :network_message_delivery_accounts do |net_msg_deliv_accts|
113120
net_msg_deliv_accts.should_update? do
114121
@network_message_delivery_accounts == nil
@@ -122,6 +129,8 @@ class Account < SoftLayer::ModelBase
122129

123130
##
124131
# Retrieve an account's network storage groups.
132+
# :call-seq:
133+
# network_storage_groups(force_update=false)
125134
sl_dynamic_attr :network_storage_groups do |net_stor_groups|
126135
net_stor_groups.should_update? do
127136
@network_storage_groups == nil
@@ -134,7 +143,10 @@ class Account < SoftLayer::ModelBase
134143
end
135144

136145
##
137-
# Retrieve an account's open tickets
146+
# Retrieve an account's open tickets. Unless you force these
147+
# to update, they will be refreshed every five minutes
148+
# :call-seq:
149+
# open_tickets(force_update=false)
138150
sl_dynamic_attr :open_tickets do |open_tickets|
139151
open_tickets.should_update? do
140152
@last_open_tickets_update ||= Time.at(0)
@@ -150,6 +162,8 @@ class Account < SoftLayer::ModelBase
150162

151163
##
152164
# Retrieve an account's portal users.
165+
# :call-seq:
166+
# users(force_update=false)
153167
sl_dynamic_attr :users do |users|
154168
users.should_update? do
155169
@users == nil
@@ -162,7 +176,10 @@ class Account < SoftLayer::ModelBase
162176
end
163177

164178
##
165-
# Retrieve an account's virtual disk images
179+
# Retrieve an account's virtual disk images. Unless you force
180+
# these to update, they will be refreshed every five minutes
181+
# :call-seq:
182+
# virtual_disk_images(force_update=false)
166183
sl_dynamic_attr :virtual_disk_images do |virtual_disk_images|
167184
virtual_disk_images.should_update? do
168185
@last_virtual_disk_images_update ||= Time.at(0)
@@ -177,7 +194,7 @@ class Account < SoftLayer::ModelBase
177194
end
178195

179196
##
180-
# The virtual servers (aka. CCIs or Virtual_Guests) associated with the
197+
# Retrieve the virtual servers (aka. CCIs or Virtual_Guests) associated with the
181198
# account. Unless you force these to update, they will be refreshed every
182199
# five minutes.
183200
# :call-seq:

lib/softlayer/AccountPassword.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ class AccountPassword < ModelBase
3232

3333
##
3434
# A description of the use for the account username/password combination.
35+
# :call-seq:
36+
# description(force_update=false)
3537
sl_dynamic_attr :description do |resource|
3638
resource.should_update? do
3739
#only retrieved once per instance

lib/softlayer/BareMetalServer.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
module SoftLayer
1010
#
1111
# This class represents a Bare Metal Server, a hardware server in contrast to a virtual machine,
12-
# in the SoftLayer Environment. It corresponds rougly to the +SoftLayer_Hardware+ and
12+
# in the SoftLayer Environment. It corresponds roughly to the +SoftLayer_Hardware+ and
1313
# +SoftLayer_Hardware_Server+ services in the SoftLayer API
1414
#
1515
# http://sldn.softlayer.com/reference/datatypes/SoftLayer_Hardware
@@ -23,7 +23,7 @@ class BareMetalServer < Server
2323
# a Bare Metal Instance is physical, hardware server that is is provisioned to
2424
# match a profile with characteristics similar to a Virtual Server
2525
#
26-
# This is an important distincition in rare cases, like cancelling the server.
26+
# This is an important distinction in rare cases, like cancelling the server.
2727
#
2828
def bare_metal_instance?
2929
if has_sl_property?(:bareMetalInstanceFlag)
@@ -65,7 +65,7 @@ def remote_management_accounts
6565
# Returns the typical Service used to work with this Server
6666
# For Bare Metal Servers that is +SoftLayer_Hardware+ though in some special cases
6767
# you may have to use +SoftLayer_Hardware_Server+ as a type or service. That
68-
# service object is available thorugh the hardware_server_service method
68+
# service object is available through the hardware_server_service method
6969
def service
7070
return softlayer_client[:Hardware_Server].object_with_id(self.id)
7171
end
@@ -146,7 +146,7 @@ def firewall_port_speed
146146
end
147147

148148
##
149-
# Retrive the bare metal server with the given server ID from the
149+
# Retrieve the bare metal server with the given server ID from the
150150
# SoftLayer API
151151
#
152152
# The options parameter should contain:

lib/softlayer/BareMetalServerOrder.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class BareMetalServerOrder
9393
attr_accessor :max_port_speed
9494

9595
##
96-
# Create a new order that works thorugh the given client connection
96+
# Create a new order that works through the given client connection
9797
def initialize (client = nil)
9898
@softlayer_client = client || Client.default_client
9999
raise "#{__method__} requires a client but none was given and Client::default_client is not set" if !@softlayer_client
@@ -195,7 +195,7 @@ def self.disk_options(client = nil)
195195
end
196196

197197
##
198-
# Returns a list of the valid :os_refrence_codes
198+
# Returns a list of the valid :os_reference_codes
199199
def self.os_reference_code_options(client = nil)
200200
create_object_options(client)['operatingSystems'].collect { |os_spec| os_spec['template']['operatingSystemReferenceCode'] }.uniq.sort!
201201
end

lib/softlayer/BareMetalServerOrder_Package.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ class BareMetalServerOrder_Package < Server
4242
# The domain of the server being created (i.e. 'softlayer.com' is the domain of sldn.softlayer.com)
4343
attr_accessor :domain
4444

45-
# The value of this property should be a hash. The keys of the hash are ProdcutItemCategory
45+
# The value of this property should be a hash. The keys of the hash are ProductItemCategory
4646
# codes (like 'os' and 'ram') while the values may be Integers or Objects. The Integer values
4747
# should be the +id+ of a +SoftLayer_Product_Item_Price+ representing the configuration option
4848
# chosen for that category. Objects must respond to the +price_id+ message and return an integer
4949
# that is the +id+ of a +SoftLayer_Product_Item_Price+. Instances of the ProductConfigurationOption
5050
# class behave this way.
5151
#
52-
# At a minimum, the configuation_options should include entries for each of the categories
52+
# At a minimum, the configuration_options should include entries for each of the categories
5353
# required by the package (i.e. those returned from ProductPackage#required_categories)
5454
attr_accessor :configuration_options
5555

lib/softlayer/Client.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
module SoftLayer
88
# A client is responsible for storing authentication information for API calls and
9-
# it serves as a centeral repository for the Service instances that call into the
9+
# it serves as a central repository for the Service instances that call into the
1010
# network API.
1111
#
1212
# When you create a client, you pass in hash arguments specifying how the client
@@ -21,16 +21,16 @@ module SoftLayer
2121
# class to provide the missing information. Please see that class for details.
2222
#
2323
class Client
24-
# A username passed as authentication for each request. Cannot be emtpy or nil.
24+
# A username passed as authentication for each request. Cannot be empty or nil.
2525
attr_reader :username
2626

27-
# An API key passed as part of the authentication of each request. Cannot be emtpy or nil.
27+
# An API key passed as part of the authentication of each request. Cannot be empty or nil.
2828
attr_reader :api_key
2929

30-
# The base URL for requests that are passed to the server. Cannot be emtpy or nil.
30+
# The base URL for requests that are passed to the server. Cannot be empty or nil.
3131
attr_reader :endpoint_url
3232

33-
# A string passsed as the value for the User-Agent header when requests are sent to SoftLayer API.
33+
# A string passed as the value for the User-Agent header when requests are sent to SoftLayer API.
3434
attr_accessor :user_agent
3535

3636
# An integer value (in seconds). The number of seconds to wait for HTTP requests to the network API
@@ -63,7 +63,7 @@ def self.default_client=(new_default)
6363
# Clients are built with a number of settings:
6464
# * <b>+:username+</b> - The username of the account you wish to access through the API
6565
# * <b>+:api_key+</b> - The API key used to authenticate the user with the API
66-
# * <b>+:enpoint_url+</b> - The API endpoint the client should connect to. This defaults to API_PUBLIC_ENDPOINT
66+
# * <b>+:endpoint_url+</b> - The API endpoint the client should connect to. This defaults to API_PUBLIC_ENDPOINT
6767
# * <b>+:user_agent+</b> - A string that is passed along as the user agent when the client sends requests to the server
6868
# * <b>+:timeout+</b> - An integer number of seconds to wait until network requests time out. Corresponds to the network_timeout property of the client
6969
#
@@ -92,7 +92,7 @@ def initialize(options = {})
9292

9393
raise "A SoftLayer Client requires a username" if !@username || @username.empty?
9494
raise "A SoftLayer Client requires an api_key" if !@api_key || @api_key.empty?
95-
raise "A SoftLayer Clietn requires an enpoint URL" if !@endpoint_url || @endpoint_url.empty?
95+
raise "A SoftLayer Client requires an endpoint URL" if !@endpoint_url || @endpoint_url.empty?
9696
end
9797

9898
# return a hash of the authentication headers for the client

lib/softlayer/Config.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module SoftLayer
1111
# The SoftLayer Config class is responsible for providing the key information
1212
# the library needs to communicate with the network SoftLayer API. Those three crucial
1313
# pieces of information are the Username, the API Key, and the endpoint_url. This information
14-
# is collected in a hash with the keys `:username`, `:api_key`, and `:endpoint_url` repsectively.
14+
# is collected in a hash with the keys `:username`, `:api_key`, and `:endpoint_url` respectively.
1515
#
1616
# The routine used to retrieve this information from a Config object is Config.client_settings
1717
#
@@ -45,7 +45,7 @@ module SoftLayer
4545
# = Environment Variables
4646
#
4747
# The config class will search the environment variables SL_USERNAME and SL_API_KEY for
48-
# the username and API key respectively. The endpoint_url may not be set thorugh
48+
# the username and API key respectively. The endpoint_url may not be set through
4949
# environment variables.
5050
#
5151
# = Global Variables

lib/softlayer/Datacenter.rb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,15 @@ module SoftLayer
1717
# represent.
1818

1919
class Datacenter < SoftLayer::ModelBase
20+
21+
##
22+
# :attr_reader:
23+
# A short location description
2024
sl_attr :name
25+
26+
##
27+
# :attr_reader: long_name
28+
# A longer location description
2129
sl_attr :long_name, "longName"
2230

2331
##
@@ -30,7 +38,7 @@ def self.datacenter_named(name, client = nil)
3038
# Return a list of all the datacenters
3139
#
3240
# If the client parameter is not provided, the routine
33-
# will try to use Client::defult_client. If no client
41+
# will try to use Client::default_client. If no client
3442
# can be found, the routine will raise an exception
3543
#
3644
# This routine will only retrieve the list of datacenters from
@@ -50,4 +58,4 @@ def self.datacenters(client = nil, force_reload = false)
5058
@@data_centers
5159
end
5260
end
53-
end
61+
end

lib/softlayer/DynamicAttribute.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
module SoftLayer
88

99
##
10-
# This module is inteneded to be used by classes in the SoftLayer
10+
# This module is intended to be used by classes in the SoftLayer
1111
# object model. It creates a small DSL for creating attributes
1212
# that update themselves dynamically (usually by making requests
1313
# to the SoftLayer API)

lib/softlayer/ImageTemplate.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module SoftLayer
99
##
1010
# A Virtual Server Image Template.
1111
#
12-
# This class rougly corresponds to the unwieldily named
12+
# This class roughly corresponds to the unwieldy named
1313
# +SoftLayer_Virtual_Guest_Block_Device_Template_Group+
1414
# service:
1515
#
@@ -23,12 +23,12 @@ class ImageTemplate < SoftLayer::ModelBase
2323
sl_attr :name
2424

2525
##
26-
# :attr_reader:
26+
# :attr_reader: notes
2727
# The notes, if any, that are attached to the template. Can be nil.
2828
sl_attr :notes, "note"
2929

3030
##
31-
# :attr_reader:
31+
# :attr_reader: global_id
3232
# The universally unique identifier (if any) for the template. Can be nil.
3333
sl_attr :global_id, 'globalIdentifier'
3434

@@ -91,7 +91,7 @@ def datacenters
9191
# appear in this array! The list given must be comprehensive.
9292
#
9393
# The available_datacenters call returns a list of the values that are valid
94-
# whithin this array.
94+
# within this array.
9595
def datacenters=(datacenters_array)
9696
datacenter_data = datacenters_array.collect do |datacenter|
9797
{ "id" => datacenter.id }
@@ -160,7 +160,7 @@ def delete!
160160
end
161161

162162
##
163-
# Repeatedly poll the netwokr API until transactions related to this image
163+
# Repeatedly poll the network API until transactions related to this image
164164
# template are finished
165165
#
166166
# A template is not 'ready' until all the transactions on the template
@@ -210,7 +210,7 @@ def softlayer_properties(object_mask = nil)
210210
#
211211
# Additional options that may be provided:
212212
# * <b>+:name+</b> (string/array) - Return templates with the given name
213-
# * <b>+:global_id+</b> (string/array) - Return templates with the given global identfier
213+
# * <b>+:global_id+</b> (string/array) - Return templates with the given global identifier
214214
# * <b>+:tags+</b> (string/array) - Return templates with the tags
215215
def self.find_private_templates(options_hash = {})
216216
softlayer_client = options_hash[:client] || Client.default_client
@@ -267,7 +267,7 @@ def self.find_private_templates(options_hash = {})
267267
#
268268
# Additional options that may be provided:
269269
# * <b>+:name+</b> (string/array) - Return templates with the given name
270-
# * <b>+:global_id+</b> (string/array) - Return templates with the given global identfier
270+
# * <b>+:global_id+</b> (string/array) - Return templates with the given global identifier
271271
# * <b>+:tags+</b> (string/array) - Return templates with the tags
272272
def self.find_public_templates(options_hash = {})
273273
softlayer_client = options_hash[:client] || Client.default_client
@@ -313,7 +313,7 @@ def self.find_public_templates(options_hash = {})
313313
end
314314

315315
##
316-
# Retrive the Image Template with the given ID
316+
# Retrieve the Image Template with the given ID
317317
# (Note! This is the service ID, not the globalIdentifier!)
318318
#
319319
# The options parameter should contain:

0 commit comments

Comments
 (0)