Class: HammerCLIForeman::Searchable

Inherits:
Object
  • Object
show all
Defined in:
lib/hammer_cli_foreman/id_resolver.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, description, options = {}) ⇒ Searchable

Returns a new instance of Searchable.



6
7
8
9
10
# File 'lib/hammer_cli_foreman/id_resolver.rb', line 6

def initialize(name, description, options={})
  @name = name
  @description = description
  @editable = options[:editable].nil? ? true : options[:editable]
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



4
5
6
# File 'lib/hammer_cli_foreman/id_resolver.rb', line 4

def description
  @description
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/hammer_cli_foreman/id_resolver.rb', line 4

def name
  @name
end

Instance Method Details

#editable?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/hammer_cli_foreman/id_resolver.rb', line 16

def editable?
  @editable
end

#plural_nameObject



12
13
14
# File 'lib/hammer_cli_foreman/id_resolver.rb', line 12

def plural_name
  ApipieBindings::Inflector.pluralize(@name)
end