Class: Fleakr::Api::Parameter

Inherits:
Object
  • Object
show all
Defined in:
lib/fleakr/api/parameter.rb

Overview

Parameter

Base class for other parameters that get passed to the Flickr API - see #FileParameter and #ValueParameter for examples

Direct Known Subclasses

FileParameter, ValueParameter

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, include_in_signature = true) ⇒ Parameter

A new named parameter (never used directly)



15
16
17
18
# File 'lib/fleakr/api/parameter.rb', line 15

def initialize(name, include_in_signature = true)
  @name                 = name
  @include_in_signature = include_in_signature
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



11
12
13
# File 'lib/fleakr/api/parameter.rb', line 11

def name
  @name
end

Instance Method Details

#<=>(other) ⇒ Object

Used for sorting when generating a signature



28
29
30
# File 'lib/fleakr/api/parameter.rb', line 28

def <=>(other)
  self.name <=> other.name
end

#include_in_signature?Boolean

Should this parameter be used when generating the signature?

Returns:

  • (Boolean)


22
23
24
# File 'lib/fleakr/api/parameter.rb', line 22

def include_in_signature?
  (@include_in_signature == true) ? true : false
end